top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to display the last record of the field in a input box using PHP?

0 votes
57 views

I have php script form which I used to input Members Details of my system into the MySQL database. My requirement is to display the last member's details in a input box.

posted Apr 17, 2017 by Kavyashree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

Get your last record as follows -

SELECT * FROM your_table ORDER BY your_auto_increment_field DESC LIMIT 1; 

and just display it...

answer Apr 19, 2017 by Salil Agrawal
0 votes

Hi,

You can find your last record using following query:

SELECT * FROM table_name  ORDER BY  primarykeyid DESC LIMIT 1;

Hope this answer will help you

answer Oct 2 by Siddhi Patel
Similar Questions
+2 votes

I have a date field on an html form that users may leave blank. If they do leave it blank I want to write the date 01/01/1901 into the mysql table. How can I accomplish this and where in my .php script file should I put the code?

–1 vote

I want to update my sql database record and want to populate the value of previous record. So anybody can help me to get the previous value of the record to show when the update require.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...