שלום,
יש לי טופס ואני מכניס איתו למסד
וזה כותב לי את השגיאה הבאה (אחרי שאני שולח את הטופס)
PHP קוד:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where ,numf ,speed ,len) VALUES ('1' , 'asd' , 'das', 'asdasda', 'das' , 'asd' ,' at line 1
הנה החלק שמכניס למסד:
PHP קוד:
//num id
$num = mysql_query("select * from `sdarot`");
$num = mysql_num_rows($num);
if ($num=="") {
$id=1;
} else {
$y=0;
for ($ii=1;$ii<=$num;$ii++) {
$nuum = mysql_query("select * from `sdarot` WHERE `id`= '$ii'");
$nuum = mysql_num_rows($nuum);
if ($nuum=="") {
$id=$ii;
$ii=999999999999;
$y=1;
}
}
if ($y==0) {
$id=$num+1;
}
}
$addser = "INSERT INTO `sdarot` (id, namehe, nameen, about, where ,numf ,speed ,len) VALUES ('$id' , '".$_POST['namehe']."' , '".$_POST['nameen']."', '".$_POST['about']."', '".$_POST['where']."' , '".$_POST['numf']."' , '".$_POST['speed']."' , '".$_POST['len']."')";
mysql_query($addser) or die (mysql_error());
תודה לעוזרים!