Is there a way to return the id of a row that was just created in MySQL with PHP?

前端 未结 6 1963
Happy的楠姐
Happy的楠姐 2021-01-19 09:52

When I create a new entry in my MySQL database, I\'d like the query to return the id of the table that was just created. If it cannot do this, is there another way to find

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-19 10:29

    Use the mysql_insert_id function... http://php.net/mysql_insert_id

    Excuse the underscores converting the 'insert' into italics... follow the link and you should be fine.

提交回复
热议问题