Jump to content

mysql_num_rows : invalid argument


jwk811

Recommended Posts

[code] $id = session_id();

$ip = $_SERVER['REMOTE_ADDR'];

$sql = "SELECT FROM polls WHERE id = '$id' or ip = '$ip'";
$result = mysql_query($sql);

$rows = mysql_num_rows($result);
if($rows > 0){
echo "One vote per person, sorry";
}
else{
$vote = $_POST['rodent'];
$poll = "feed";
$sql = "INSERT INTO polls(id, ip, vote, poll, date) VALUES('$id', '$ip', '$vote', '$poll', NOW())";
$result = mysql_query($sql);
}[/code]
why am i getting that error?
Link to comment
https://forums.phpfreaks.com/topic/36218-mysql_num_rows-invalid-argument/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.