Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Jverg on
What I really want is to copy the uid column and create a new table with the uids from watchdog with the name blablabla... Could anyone help me solve this problem?
Comments
Not with the little
Not with the little information you've given us.
Please explain further.
ok
i want to create an extra table in the database with the name blablabla and what i want to have this table is only the uid column with each values from the watchdog.
DB Query
You can write query something like below if you don't want code.
Thanks,
Vijay Thummar
Why would you need that? You
Why would you need that? You already have all the UIDs in the watchdog table. You can query them from there.
i want them
i want them because in my module i need to delete some of them and i do not want to delete it from watchdog.
In that case, as Vijaythummar
In that case, as Vijaythummar said, you want hook_schema(): https://api.drupal.org/api/drupal/modules!system!system.api.php/function...
yes i saw
I saw this link but how i can pass the uid from watchdog in my new table?
When install the module
I want this table to create when i install the module. Plz help me solve this problem out.
hook_schema
Use Drupal hook called hook_schema to create table on module installation.
Thanks,
Vijay Thummar
ok with all that
Ok with all that thinks but the code how would be in .install file in order to catch my purpose??
_
you're not going to be able to just improvise your way through creating a drupal module-- i suggest familiarizing yourself with the developer docs and perhaps buy a book.