-1
我使用mysqli_multi_query
執行多個查詢。我嘗試了很多東西,但找不到最後插入的ID。查找上次插入的ID,同時執行多個查詢
$fetchbasic = mysqli_fetch_array($resCheckres);
$cpyname = $fetchbasic['name'].'(copy)';
$query1 = "CREATE TEMPORARY TABLE tmptable_1 SELECT * FROM name_webinfo WHERE resume_id = ".$resume_id.";
UPDATE tmptable_1 SET resume_id = NULL , name = '".$cpyname."';
INSERT INTO name_webinfo SELECT * FROM tmptable_1;
DROP TEMPORARY TABLE IF EXISTS tmptable_1;";
$resCheckres = mysqli_multi_query($link,$query1);
我需要最後插入的ID此查詢:INSERT INTO name_webinfo SELECT * FROM tmptable_1;
請問您能否清楚解釋您的問題 –
i需要lastinsertid這個查詢「INSERT INTO name_webinfo SELECT * FROM tmptable_1;」 – patel
'從tmptable_1'選擇MAX(ID)如果是工作,請使用這個bro請告訴我 –