PHP/MySQL insert row then get 'id'

前端 未结 10 1064
臣服心动
臣服心动 2020-11-22 16:03

The \'id\' field of my table auto increases when I insert a row. I want to insert a row and then get that ID.

I would do it just as I said it, but is there a way I c

10条回答
  •  孤街浪徒
    2020-11-22 16:36

    Try like this you can get the answer:

    
    

    Have a look at following links:

    http://www.w3schools.com/php/func_mysqli_insert_id.asp

    http://php.net/manual/en/function.mysql-insert-id.php

    Also please have a note that this extension was deprecated in PHP 5.5 and removed in PHP 7.0

提交回复
热议问题