WHERE voter="'.$voter.'"
hey friends
i want to direct clear a single coloum by user table
i use to clear a table this via this php code only run code my table clear
$db->delete_data("DELETE FROM b_vote");
but dnt knw how to clear a single row or coloum from the table .....
dnt do via sql database or myphpadmin
i want put in php script...
so help me for that!
WHERE voter="'.$voter.'"
Last edited by something else; 01-03-12 at 05:25.
$db->delete_data("DELETE FROM users WHERE vote="'.$vote.'" ");
i get this error
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\forum\clearvote.php on line 8
?
$db->delete_data( "DELETE FROM users WHERE vote='$uid' ");
i also put this but give error
Notice: Undefined variable: uid in C:\wamp\forum\clearvote.php on line 8
WHERE voter = '$voter'
or look in the table structure to see if it has the uid or user id column and add this ,
WHERE uid = '$user_id'
or
WHERE user_id = '$user_id'
depending on how your table is structured
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Originally Posted by 12345xmen [Only registered and activated users can see links. Click Here To Register...]
Better to use
And yout need to Define $uidCode:mysql_query("DELETE FROM users WHERE vote='$uid");
let
orCode:$uid = 1;
Code:$uid = $_GET['id'];
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
Added after 14 minutes:PHP 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/>
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
Last edited by 12345xmen; 01-03-12 at 09:13.
$vote isnt assigned to anythingOriginally Posted by 12345xmen [Only registered and activated users can see links. Click Here To Register...]
no where i assine for that !
in place ofOriginally Posted by 12345xmen [Only registered and activated users can see links. Click Here To Register...]
mysql_query("DELETE FROM users WHERE userid= '$userid'");
use this code
mysql_query("UPDATE users SET vote = 0 WHERE userid= '$userid'");
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks