| insert_id() | ใช้คืนค่า ข้อมูลของ field ที่เป็นแบบ auto_increment ของ record ล่าสุดที่ถูกเพิ่มลงใน table |
|---|
method:insert_id ();
return type:int
class:result
content:ใช้คืนค่า ข้อมูลของ field ที่เป็นแบบ auto_increment ของ record ล่าสุดที่ถูกเพิ่มลงใน table
example:$sql = "insert into bamboo ( id, name ) values ( 10, 'panda' ) "; $conn = new Database (); $result = $conn->query ( $sql ); echo $result->insert_id ();