<?php
mysql_connect("localhost","root","");
mysql_select_db("inventory");
$data=mysql_query("SELECT product_name, cp FROM product WHERE qty=0");
$rec=mysql_fetch_row($data);
if(mysql_query("INSERT INTO outofstock (product_name, quantity) VALUES ('$rec['product_name']', '$rec['qty']')"))
{
echo "Added";
}
?>
当我运行此操作时,我收到此错误 - &gt;
语法错误,意外''(T_ENCAPSED_AND_WHITESPACE),期待 标识符(T_STRING)或变量(T_VARIABLE)或数字 第8行的C:\ xampp \ htdocs \ inventory \ outofstock.php中的(T_NUM_STRING)