this is my user table
CREATE TABLE IF NOT EXISTS users (
userid bigint(20) unsigned NOT NULL AUTO_INCREMENT,
username text,
password text,
email text,
groupid bigint(20) unsigned NOT NULL DEFAULT '0',
rank varchar(255) NOT NULL DEFAULT '0',
vote bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (userid)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
i want its clear users table all vote count form vote colum or row
now tell me how i do that above way not wrk for me
this is my vote clear code
<?php
include "include/init.php";
if(isloggedin())
{
if($group[$user->groupid]['type'] == 3 || $group[$user->groupid]['type'] == 4 )
{
$db->delete_data( "DELETE FROM users WHERE vote='$vote' ");
}
else
{
print "You dont have permission for this."; exit;
}
}
?>
<span style="font:normal 10pt verdana;">Votes Cleared</span><br/><br/>
<a href="../forum/index.php">Back to home</a> <br/>
Added after 14 minutes:
if i put this
mysql_query("DELETE FROM users WHERE userid= '$userid'");
wrk fi9 but when i use
mysql_query("DELETE FROM users WHERE vote= '$vote'");
get this
Notice: Undefined variable: vote in C:\wamp\www\forum\clearvote.php on line 9