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

Jaypan’s picture

Not with the little information you've given us.

Please explain further.

Jverg’s picture

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.

vijaythummar’s picture

You can write query something like below if you don't want code.

INSERT INTO test (uid)
    SELECT watchdog.uid
    FROM watchdog

Thanks,
Vijay Thummar

Jaypan’s picture

Why would you need that? You already have all the UIDs in the watchdog table. You can query them from there.

Jverg’s picture

i want them because in my module i need to delete some of them and i do not want to delete it from watchdog.

Jaypan’s picture

In that case, as Vijaythummar said, you want hook_schema(): https://api.drupal.org/api/drupal/modules!system!system.api.php/function...

Jverg’s picture

I saw this link but how i can pass the uid from watchdog in my new table?

Jverg’s picture

I want this table to create when i install the module. Plz help me solve this problem out.

vijaythummar’s picture

Use Drupal hook called hook_schema to create table on module installation.

Thanks,
Vijay Thummar

Jverg’s picture

Ok with all that thinks but the code how would be in .install file in order to catch my purpose??

WorldFallz’s picture

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.