我有两个名为
的表newlab(Department_Name,Total_PC,MAC,Lab_Code,PC_Name,Purchase_Order_No,Brand,Model_Name,Price,Processor,Ram,HDD,HDD_Type,OS)
和
maintenance(Department_Name,MAC,Lab_Code,PC_Name,Purchase_Order_No,Brand,Model_Name,Price,Processor,Ram,HDD,HDD_Type)
我想将newlab中的数据插入到维护中。
我的代码是
$sql = "INSERT INTO ` maintenance`(MAC,Lab_Code,PC_Name,Purchase_Order_No,Brand,Model,Price,Processor,Ram,HDD,HDD_Type)SELECT MAC,Lab_Code,PC_Name,Purchase_Order_No,Brand,Model_Name,Price,Processor,Ram,HDD,HDD_Type FROM `newlab` WHERE PC_Name='".$PC_Name."'";
$ress = mysqli_query($con,$sql);
if(!$ress)
{
echo "Not done";
}
但问题是它始终输出 - "未完成"。我想知道为什么不执行查询。