Le dimanche 25 juillet 2010 à 18:55 +0200, Julien Valroff a écrit : > Hi Dudi, > > Le dimanche 25 juillet 2010 à 19:37 +0300, Dudi Goldenberg a écrit : > > > Is there a way/script to remove a user (by his UID) including all > > DSPAM data associated with this user? > > I use the following PHP cli script (it takes the user id as argument, > which might not be what you want): > > #!/usr/bin/php > > <?php > $server = "127.0.0.1"; > $user = "<dspam_db_user>"; > $pwd = "<dspam_db_password>"; > > $link = mysql_connect($server, $user, $pwd); > if (!$link) { > die('Could not connect: ' . mysql_error()); > } > > $db_selected = mysql_select_db("dspam", $link); > if (!$db_selected) { > die (mysql_error()); > } > > $alltables = mysql_query("SHOW TABLES") or die(mysql_error()); > > while ($tableName = mysql_fetch_array($alltables)) { > echo " - Cleaning " . $tableName[0] . "\n"; > mysql_query("DELETE FROM `".$tableName[0]."` WHERE > uid>."$_SERVER['argv'][1].") or die(mysql_error());
Should obviously be mysql_query("DELETE FROM `".$tableName[0]."` WHERE uid=."$_SERVER['argv'][1].") or die(mysql_error()); (= and not > !!!!!!) Cheers, Julien -- Julien Valroff <jul...@kirya.net> http://www.kirya.net GPG key: 4096R/290D20C5 092F 4CB5 5F19 E006 1CFD B489 D32B 8D66 290D 20C5 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Dspam-user mailing list Dspam-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspam-user