我有一个汽车应用程序,所以汽车有一堆信息可以计算,现在我把必需品放在一张叫做桌子的桌子上auto
,然后我做了一个巨大的桌子来attributes
酷。现在我希望我可以将相同的数组数据插入到同一个 pdo 下的两个不同的表中
$sql = "INSERT INTO auto(year, make, model, mileage, price, vin, att1, att2,
att3, att4, picture1, picture2, picture3, picture4, picture5, picture6, picture7, picture8,
picture9, picture10, picture11, picture12)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
我可以做类似的事情吗'AND INSERT INTO attributes ('
$sth = $dbh->prepare($sql);
$final = array_merge(array_values($vehicleinfo),array_values($paths));
$sth->execute($final);
echo '<h4 id="successMessage" style="color: red;">Vehicle added succesfully</h4>';