Why is the table filled with Array[0]
, Array[1]
, Array[2]
, Array[3]
after the following SQL statement is executed?
mysql_query("INSERT INTO choicetable (announcementid, question, option1, option2, option3, option4)
VALUES ('$announcementid', '$choicequestion[$j]', '$option[$j][0]', '$option[$j][1]', '$option[$j][2]', '$option[$j][3]')")
or die(mysql_error());
When I echo $option[$j][0];
, it displays the true value. But the value of $option[$j][0]
, $option[$j][1]
, $option[$j][2]
, $option[$j][3]
cannot be inserted into the table. What's wrong?
I am using MySQL.