Jump to content

mysqli_insert_id, insert, query, highest record


WesleyA

Recommended Posts

For these query (if exists) I am searching.

 

If you want to select the last added record I use this query

     	$hi_val = mysqli_insert_id($conn);	

Above code works but only if I have just added with INSERT, but I want to use it with SELECT.

 

 

 

I also have a php part in combination with COUNT ROWS and then determine the highest record value.

 

But I am looking for MYSQL query that counts and determines the last added record and select it.

 

what solutions do you know?

Edited by WesleyA
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...