How to get the last field in a Mysql database with PHP?

前端 未结 5 1840
故里飘歌
故里飘歌 2020-12-19 13:21

I have mysql database and I want to get the last ID from field in a table .

example : -

id   Value
1    david
2    jone
3    chris

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-19 13:53

    you can also use the following code ::

     $lastId = mysql_insert_id();
    

提交回复
热议问题