Jump to content

Recommended Posts

...how to select all rows but not the last row using PHP/MSQL database .
What is different about the "last" row? Can you simply avoid it with a condition?
Link to comment
Share on other sites

You get the count: SELECT COUNT(*) AS num FROM table And then you use that count in the next query: SELECT * FROM table LIMIT 0, {$count - 1} You need to use PHP to fill in $count - 1, because the numbers in a limit clause need to be constants, you can't do it with 1 query.

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...