jwk811 Posted January 29, 2007 Share Posted January 29, 2007 [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? Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted January 29, 2007 Share Posted January 29, 2007 Change [code]$sql = "SELECT FROM polls WHERE id = '$id' or ip = '$ip'";[/code] to [code]$sql = "SELECT * FROM polls WHERE id = '$id' or ip = '$ip'";[/code] Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 29, 2007 Share Posted January 29, 2007 And to catch these errors earlier, do:$result = mysql_query($sql) OR die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.