אשכול: שאלה ב php
View Single Post
ישן 10-09-08, 13:57   # 4
kfir91
חסום
 
מיני פרופיל
תאריך הצטרפות: Apr 2007
הודעות: 220

kfir91 לא מחובר  

ידעתי שזה foreach לא ידעתי רק איך להשתמש תודה.. אבל זה מראה לי שגיאה כזאתי :
קוד:
ERROR: 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 'option,questionid,votes) VALUES('2', '3', '0')' at line 1
טוב זה לא קשור לתנאי זה כבר קשור ל insert
סתכל :
קוד:
foreach($_POST['option'] as $option) { 
mysql_query("INSERT INTO polloptions (option,questionid,votes) VALUES('".$option."', '".$question_id."', '0')") or die("ERROR: ".mysql_error());
}

Last edited by kfir91; 10-09-08 at 14:02..
  Reply With Quote