Accessing last created row in PHP/MySQL

前端 未结 4 1886
面向向阳花
面向向阳花 2020-12-11 23:06

How to access the row which has just been inserted into a DB with PHP/MySQL?

I have:

    $sql = \'INSERT INTO `jos_db`.`jos_sections` (`id`,  `name`)         


        
4条回答
  •  情书的邮戳
    2020-12-11 23:43

    Using the PHP function mysql_insert_id() will return the id of the last row you inserted.

提交回复
热议问题