how to show last inserted record id from mysql database on live site?

2017-04-04T18:27:48

I want to show highest record id from mysql database on live. I am using following code and it's working on localhost but not on live site.

 <?php
$q ="SELECT LAST_INSERT_ID()";
$result = mysqli_query($q);
$data = mysqli_fetch_array($result);
echo $data[0];
?> 

Copyright License:
Author:「Neeya」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/43204616/how-to-show-last-inserted-record-id-from-mysql-database-on-live-site

About “how to show last inserted record id from mysql database on live site?” questions

I want to show highest record id from mysql database on live. I am using following code and it's working on localhost but not on live site. &lt;?php $q ="SELECT LAST_INSERT_ID()"; $result =
What I want to do is I want to update the last inserted ID of the mysql database to insert my uploaded file name to that last inserted ID row under the img. This adding name function will be running
I am building a web application, which can be used by multiple users simultaneously. They can add data at the same time. I have a table named doctor_main as follows Screenshot of DB http://img687.
My problem is similar to the one in this question: MySQL ON DUPLICATE KEY - last insert id? I have a Tag table in MYSQL with three columns. tagid, tagname and topicid and another irrelevant table. I
am trying to insert a record in mysql database and fetch the last inserted record on success of insertion using nifi. below is flow structure am trying. convertJsontomysql -&gt; putSQL(insert reco...
I am newbie to mybatis. I am trying to get the id of last inserted record. My database is mysql and my mapper xml is &lt;insert id="insertSelective" parameterType="com.mycom.myproject.db.mybatis.
I got a question. I can't seem to get the last inserted record/id from my MySQL database/table. I want to return the last inserted id from the column 'tag_id', but I'm not getting anything back at ...
I am trying to fetch last inserted object from core database. But i did't find way to fetch last inserted object from database. Currently i am fetching all records from database in array and using ...
I need to retrieve every id of last inserted records inside the account.analytic.line so that can insert the value of that id into line_id in hr_analytic_timesheet in order to show the record inse...
Apologies, I am completely new to Django. My question is that I have 20 records in my database table and suppose 10 record is of same ID and I want to fetch last inserted record for that id I have ...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.