這是我從PHP表中刪除行的編碼。錯誤:調用未定義函數
<html>
<?php
include("DBConfig/Db_connection.php");
if(isset($_POST['Reassign'])){
if(isset($_POST['checkbox']))
{
$id = $_POST['Reassign'];
$id1 = $_POST['checkbox'];
$sql = "INSERT INTO archived SELECT * FROM faults WHERE id='$id1';";
$sql .= "DELETE FROM faults WHERE id='$id1'; ";
$sql = mysql_multiquery($sql,$dbcon);
if (!$mysqli->multi_query($sql)) {
echo "Multi query failed: (" . $mysqli->errno . ") " . $mysqli->error;
}
else{
echo "Assigned successfully";
}
}
}
?>
<script>
function mysql_multiquery($queries,$conn)
{
$queries = explode(";", $queries);
foreach ($queries as $query)
$query = mysql_query(trim($query),$conn);
}
</script>
</html>
這給我錯誤調用未定義函數mysql_multiquery()。 有誰知道原因?
因爲該功能不存在?附:你不能混合和匹配mysql_ *和mysqli_ *。 –
嘗試'mysqli_multi_query'代替 –
javascript函數不能在PHP中直接調用,這是對他只是文本(PHP執行'<?php'標籤什麼的) – Kaddath