1
$marks . $count = mysqli_real_escape_string($con, $_POST['marks$count']);
我想在($con . $_POST[]
)我如何使用PHP代碼以這種方式
使用$count
(可變)但是當我試着它給了我錯誤。我非常新的PHP編碼。
$marks . $count = mysqli_real_escape_string($con, $_POST['marks$count']);
我想在($con . $_POST[]
)我如何使用PHP代碼以這種方式
使用$count
(可變)但是當我試着它給了我錯誤。我非常新的PHP編碼。
你可以這樣做:
for($count=0;!empty($_POST['marks'][$count]);$count++){
$marks[$count] = mysqli_real_escape_string($con, $_POST['marks'][$count]);
}
在週期結束時,數組$標記將包含所有逃脫數組$ _ POST [「標記」]的值。
您無法在分配之前進行連接。使用字符串變量級聯的正確方法:
$marks .= $count; //option 1
$newVar = $marks.$count; //option 2
$marks = $marks.$count; //option 3
$newVar = "$marks$count"; //option 4
您嘗試的方式沒有明確的變量來進行賦值。等號右邊的值被分配給等號左邊的內容。左側的兩個變量是不明確的。
啊我想這種幫助我看看他想做什麼。 – 2014-09-28 15:57:44