MySQL Forums
Forum List  »  PHP

Getting last row even with Limit
Posted by: Andy Edwards
Date: January 31, 2010 12:12PM

Hello I had a query and wanted to know about how to resolve this.

I am using PHP and MySQL to get data from a table. My code is

"

$queryA = 'SELECT estimate_attachment.*, estimate.* FROM ';

$queryA.= '(estimate LEFT JOIN estimate_attachment ON estimate.estimate_id = estimate_attachment.att_estid) ';

$queryA.= 'WHERE estimate_id="'.$_GET["estid"].'" ORDER BY att_created DESC LIMIT 1';

"

Most of the records have the same date and multiple rows exist for that estid. However, it brings back a row which is still not the last row. When I browsed to the data there are 23 rows so it should bring back record 23 but instead it brings back row 14. Do you know why it does that? Thanks for your help.

Options: ReplyQuote


Subject
Written By
Posted
Getting last row even with Limit
January 31, 2010 12:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.