[英]Multiple insert in the same query?
我該如何改善? 這看起來太可怕了。
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 101, 1, 2460, 1, '')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 102,3,1988,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 103,4,2465,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 104,5,2511,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 105,6,2394,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 106,7,2478,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 107,8,2643,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 108,10,2050,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 109,102,2120,1,'')");
$db->query("INSERT INTO items (player_id, sid, pid, itemtype, count, attributes) VALUES (".$db->lastInsertId().", 110,102,2554,1,'')");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.