我正在尝试在 MySQL muli_query 中使用最后插入的 id,但我不知道我错过了什么
这是我的代码:
$query = "INSERT INTO posts
(nparc,id_chauffeur,id_camion,
lot_de_bord,triangle,pelle,balai,date)
values('$nparc','$id_chauffeur','$id_camion',
'$lot_de_bord','$triangle', '$pelle',
'$balai','$get_datetime');";
$query .= "INSERT INTO photos
(post_id,64_image1, 64_image2, 64_image3,
64_image4 ,date_upload)
values('$mysqli->insert_id','$imsrc1','$imsrc2',
'$imsrc3','$imsrc4','$get_datetime');";
$result = mysqli_multi_query($connection, $query) ;
开满天机