Code: Select all
$last_id = mysql_insert_id();
Moderators: mindphp, ผู้ดูแลกระดาน
Code: Select all
$last_id = mysql_insert_id();
ตัวอย่างthatsawan wrote:วิธีที่ง่ายที่สุดคือ
1. หลังจาก insert ไปเเล้ว ต้องหาไห้รู้ว่า ID ล่า่สุดที่ insert เข้าไปเป็น ID อะไร
ลองคำสั่งนี้2. หลังจากนั้นให้ทำ redirect หน้าไป ที่ url ใหม่Code: Select all
$last_id = mysqli_insert_id($con)
Code: Select all
header( "location: ***/***/showvat.php?id=$last_id" ); exit(0);
Users browsing this forum: No registered users and 19 guests