|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
just a quickie...
Can you run a query on a table in the database, find those results, and then run another query just on those previous results?
If so, how would you go about doing it? See, I've got a tour dates page for my band, which queries the table to split the dates into two groups, Upcoming dates and Past dates. I now want to query the upcoming dates so that only the very next gig appears, without the others. See, the way I split the dates into Upcoming and Past was to run two queries, and place the results in different tables. Eg. Upcoming Find todays date, search the table and find dates larger than todays date, display those results. Past search the table and find dates smaller than todays date, display those results. So in the Upcoming query, would I be correct in saying that once its found those results, I should then run another query on those results to find the date with the smallest number? How would I do that? Any idea? As you can guess, I'm relatively inexperienced at PHP. |
|
#2
|
|||
|
|||
|
RE: just a quickie...
if you only want to show your very next gig you can run a query like:
SELECT * FROM gigs WHERE date > NOW() ORDER BY date DESC LIMIT 1 in this query i assume you store the date of the gigs in a field 'date'. |
|
#3
|
|||
|
|||
|
RE: just a quickie...
AHA! Thanks a million - I should have remembered about limits... now I feel stupid!
Thanks again. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > just a quickie... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|