PHP ver gevorderde |
|
<?php
$mag = mysql_query("SELECT `id` FROM `poll_votes` WHERE `poll_id` = '". $pollid ." AND `ip` = '". $_SERVER['REMOTE_ADDR'] ."' LIMIT 1");
mysql_query("INSERT INTO `poll_votes` (`poll_id`, `answer_id`, `ip`) VALUES ('". $pollid ."', '". $voteid ."', '". $_SERVER['REMOTE_ADDR'] ."')") or die(Mysql_Error());
?>
<?php $mag = mysql_query("SELECT `id` FROM `poll_votes` WHERE `poll_id` = '". $pollid ." AND `ip` = '". $_SERVER['REMOTE_ADDR'] ."' LIMIT 1"); mysql_query("INSERT INTO `poll_votes` (`poll_id`, `answer_id`, `ip`) VALUES ('". $pollid ."', '". $voteid ."', '". $_SERVER['REMOTE_ADDR'] ."')") or die(Mysql_Error()); ?>
(Update) : Als deze query's een fout opleveren, klopt je database tabel niet .. die moet je dan ook even plaatsen.. |