On 8/11/2005, "[EMAIL PROTECTED]"  wrote:

>
>
>
>
>>I don't have your code, so I don't know. ;)
>
>>Try to run the sql-statement by hand with phpmyadmin. Are you getting 
>>correct result? 
>
>LOL, good idea... I just tried it with phpMyAdmin and it's still selecting the 
>second to last record, not THE last!
>
>Here's the SQL query again:
>SELECT equipment.type AS type, equipment.menu AS menu, pireps.id AS id, 
>pireps.departure_airport AS dep, pireps.arrival_airport AS arr, 
>pireps.aircraft AS aircraft, pireps.month AS month, pireps.day AS day, 
>pireps.year AS year
>FROM pireps
>LEFT JOIN equipment ON pireps.aircraft = equipment.type
>WHERE pireps.pilot_id=100 AND pireps.aircraft IS NOT NULL 
>GROUP BY equipment.type
>ORDER BY pireps.id DESC LIMIT 1
>
>That query pulls up the second to last record with a record id of 15357, but 
>the actual last record is record id 15379, which is the next record for this 
>particular "pilot_id" and should be the one displayed with the limit 1 clause.
>
>thanks,
>Lance
>
>

Lance - what happens if you try a LEFT OUTER JOIN?

That is, is it possible the join is not working on the "last" record
until some other event occurs?

Mike


------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hfeuos1/M=362131.6882499.7825260.1510227/D=groups/S=1705005703:TM/Y=YAHOO/EXP=1123791045/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to