Menu
Having a little issue here.
I want to delete some make-believe accounts from my MySQL DB and I’m not quite understanding why this simple script/query doesn’t work.
[code=php]
function deleteUsers(){
global $wpdb;
$userdelete = $wpdb->query( “DELETE * FROM {$wpdb->users} WHERE user_login != ‘admin’ “);
if(! $userdelete )
{
die(‘Could not delete data: ‘ . mysql_error());
echo ‘deletion didnt work for users’;
}
}
It is a WordPress site that’s where the $wpdb->users is coming from…$wpdb is an object and “users” is the table… so that part is right…but can anyone see any other errors?