On 18.02.2011 03:24, [email protected] wrote: > SELECT user_id FROM users WHERE username LIKE '$ARGV' > UPDATE identities SET del=1 WHERE user_id = '$user_id' > DELETE FROM cache WHERE user_id = '$user_id' > UPDATE contacts SET del=1 WHERE user_id = '$user_id' > UPDATE contactgroups SET del=1 WHERE user_id = '$user_id' > DELETE FROM messages WHERE user_id = '$user_id' > > ??DELETE FROM users WHERE username = '$ARGV' LIMIT 1?? > > This last line is where I get stuck because I don't really want to delete > it, but there is no del column to mark. . .
When you delete a user record all related records in other tables will be auto-removed because of foreign key constraints. We would probably need to add users.del column, but there will be a problem with uniqueness constraint (or creation of the same user will fail until you remove the original record). I don't know if this is a real problem. Then all you need will be just to set this column. -- Aleksander 'A.L.E.C' Machniak LAN Management System Developer [http://lms.org.pl] Roundcube Webmail Developer [http://roundcube.net] --------------------------------------------------- PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/8f4f07cd
