root/trunk/robots/delete_all.bot.php
| Revision 1, 1.1 KB (checked in by anonymous, 7 years ago) |
|---|
| Line | |
|---|---|
| 1 | #!/usr/bin/php |
| 2 | <? |
| 3 | include ('../includes/includes.inc.php'); |
| 4 | include ('../includes/config/global.inc.php'); |
| 5 | |
| 6 | $db =& DB::connect($dsn); |
| 7 | if (DB::isError($db)) |
| 8 | error_log($_SERVER['HTTP_HOST'].' | '.__FILE__.' | Connexion SQL impossible : '.$db->getMessage()); |
| 9 | |
| 10 | $db->setFetchMode(DB_FETCHMODE_ASSOC); |
| 11 | |
| 12 | $tables = array ('access', 'album','blog','blog_categorie','blog_comment','bookmarks','cache_user','community','community_cat','community_event','community_post','community_topic','invitation','message','relation','session','settings', 'todo','user','user_comm','user_contact','user_general','user_interests','user_personal','user_professional','user_schools', 'rss_blog','rss_blog_ticket'); |
| 13 | |
| 14 | foreach($tables as $table) |
| 15 | $db->query('DELETE FROM ! WHERE id=?', array($table, $argv[1]) ); |
| 16 | $db->query('DELETE FROM relation WHERE id_friend=?', array($argv[1]) ); |
| 17 | $db->query('DELETE FROM message WHERE id_from=?', array($argv[1]) ); |
| 18 | $db->query('DELETE FROM invitation_email WHERE id_invit=?', array($argv[1]) ); |
| 19 | print $user['id'].' '.$user['fname'].' '.$user['lname']."\n"; |
| 20 | |
| 21 | $db->disconnect(); |
| 22 | ?> |
Note: See TracBrowser
for help on using the browser.
