我的IDE期待分號,但我不知道在哪裏! 正是這條線是突出:解析錯誤:語法錯誤,意外T_VARIABLE - 分號
,'$other_writ' WHERE id="$_SESSION[user_id]")
這是上面的代碼:
if (!empty($_POST['doLanguage']) && $_POST['doLanguage'] == 'Submit')
{
session_start();
foreach($_POST as $key => $value)
$id = "$_SESSION[user_id]";
if(empty($err)) {
for($i = 0; $i < count($_POST["other"]); $i++);
{
$native = mysql_real_escape_string($_POST['native'][$i]);
$other = mysql_real_escape_string($_POST['other'][$i]);
$other_list = mysql_real_escape_string($_POST['other_list'][$i]);
$other_read = mysql_real_escape_string($_POST['other_read'][$i]);
$other_spokint = mysql_real_escape_string($_POST['other_spokint'][$i]);
$other_spokprod = mysql_real_escape_string($_POST['other_spokprod'][$i]);
$other_writ = mysql_real_escape_string($_POST['other_writ'][$i]);
$sql_insert = "INSERT into `language`
(`native`,`other`,`other_list`,`other_read`, `other_spokint`
,`other_spokprod`,`other_writ` )
VALUES
('$native','$other','$other_list','$other_read','$other_spokint','$other_spokprod'
,'$other_writ' WHERE id="$_SESSION[user_id]")";
mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
}
感謝您的幫助!
我想你在定義for循環的行上有一個額外的分號:'for($ i = 0; $ i
clexmond
2012-03-27 21:31:45