Re: need help to build a query
| From: | afan at afan dot net | Date: | Mon, 09 Oct 2006 20:50:04 +0000 |
| Subject: | Re: need help to build a query | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242874@lists.php.net to get a copy of this message | ||
while I was trying again I did something wrong (?) and my server is now
"busy" and looks like it went down?!?
The qestion is how can I check first query before I apply it to be sure
I'm not goig to read every record in my DB or get into loop?
thanks.
-afan
> On 10/9/06, afan@afan.net <afan@afan.net> wrote:
>> but I know there must be much better solution then this one.
>
> You're right: Simply JOIN your queries...
>
> SELECT order_id, order_date, order_status, file_name
> FROM orders
> JOIN uploaded_files AS uf ON orders.order_id = uf.order_id
> ORDER BY orders.order_id DESC
> LIMIT 100
>
> HTH,
> John W
>
>
>>
>> thanks for any help.
>>
>> -afan
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>