I have two tables named
newlab(Department_Name,Total_PC,MAC,Lab_Code,PC_Name,Purchase_Order_No,Brand,Model_Name,Price,Processor,Ram,HDD,HDD_Type,OS)
and
maintenance(Department_Name,MAC,Lab_Code,PC_Name,Purchase_Order_No,Brand,Model_Name,Price,Processor,Ram,HDD,HDD_Type)
I want to insert data from newlab to maintenance.
My code is
$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";
}
But the problem is that it always Outputs - "Not done". I want to know why the query is not executed.