zoliky
07-23-06, 06:44 AM
I have two mysql table.
The first table called register and the second table called user2groups
Register has more columns, the first column is id :
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
The second table (user2groups) has a columnn called id
id INT NOT NULL,
id in second table get the value from first table (id)
An example:
register:
id | username | email
1 zoliky something
2 david
user2groups:
id | group
1 1 <- This is zoliky added to group 1 by default
2 1 <- This is david added to group 1 by default
When i remove "zoliky" user, I remove with:
mysql_query("DELETE FROM register WHERE username='zoliky'");
This query remove this line from register
1 zoliky something
But value 1 remain in user2groups table.
I hear I need to use Innodb or INDEX to remove automaticly the id from user2groups, is true ?
Anyone help me with an example ?
The first table called register and the second table called user2groups
Register has more columns, the first column is id :
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
The second table (user2groups) has a columnn called id
id INT NOT NULL,
id in second table get the value from first table (id)
An example:
register:
id | username | email
1 zoliky something
2 david
user2groups:
id | group
1 1 <- This is zoliky added to group 1 by default
2 1 <- This is david added to group 1 by default
When i remove "zoliky" user, I remove with:
mysql_query("DELETE FROM register WHERE username='zoliky'");
This query remove this line from register
1 zoliky something
But value 1 remain in user2groups table.
I hear I need to use Innodb or INDEX to remove automaticly the id from user2groups, is true ?
Anyone help me with an example ?