私はこれが完全に間違った方法であると仮定しています。誰か助けてもらえますか?
あるテーブルから特定の商品番号の行をすべて取り出し、売れたら別のテーブルに入れたいと考えています。
前もって感謝します。
$addinfo1 ="";
//Connect to the database through our include
include_once "connect_to_mysql.php";
$sql = mysql_query("SELECT * FROM tm_interested_buyers WHERE fk_product_id='$productid");
while($row = mysql_fetch_array($sql)){
$interestedbuyersid = $row["pk_interested_buyers_id"];
$fkproductid = $row["fk_product_id"];
$fkcustomerid = $row["fk_customer_id"];
$addinfo1 .= mysql_query("INSERT INTO tm_int_buyers_complete (fk_interested_buyers_id, fk_product_id, fk_customer_id) VALUES('$interestedbuyersid','$fkproductid','$fkcustomerid')") or die (mysql_error());
echo $addinfo1;
}