PHP interesse |
|
Hallo,
Mischien een n00b foutje, maar ik zie em niet .
Ik heb die scriptje (nog niet af!).
<?php
include"global.inc.php";
boven();
$ip = $_SERVER['REMOTE_ADDR']; // IP adres
if(isSet($_POST['submit']))
{
if($_POST['andwoord'] == "") {
Echo'ERROR!!!';
} else {
mysql_query("UPDATE poll SET stemmen = stemmen+1 WHERE id = '1'")or die(mysql_error());
mysql_query("UPDATE poll SET '".$_POST[andwoord]."' = '".$_POST[andwoord]."' + 1 WHERE id=1")or die(mysql_error());
}
} else {
$s = "SELECT * FROM poll";
$a = mysql_query($s);
While($list = mysql_fetch_object($a))
{
Echo'<form method="post" action="poll.php">';
for($i=1; $i <= $list->aantal; $i++)
{
$keuze = "andwoord$i";
$keuze2 = "keuze$i";
Echo '<input type="radio" name="andwoord" value="'.$keuze.'"> '.$list->$keuze2.'<BR>';
}
}
Echo'<center><BR><input type="submit" name="submit" value="Stem"></center>';
}
onder();
?>
<?php include"global.inc.php"; boven(); $ip = $_SERVER['REMOTE_ADDR']; // IP adres if(isSet($_POST['submit'])) { if($_POST['andwoord'] == "") { } else { } } else { $s = "SELECT * FROM poll"; { Echo'<form method="post" action="poll.php">'; for($i=1; $i <= $list->aantal; $i++) { $keuze = "andwoord$i"; $keuze2 = "keuze$i"; Echo '<input type="radio" name="andwoord" value="'.$keuze.'"> '.$list->$keuze2.'<BR>'; } } Echo'<center><BR><input type="submit" name="submit" value="Stem"></center>'; } onder(); ?>
Nu krijg ik deze error als ik op "stem" klik:
You have an error in your SQL syntax near ''' = '' + 1 WHERE id=1' at line 1
Wie ziet de fout?
|