Jump to content

[SOLVED] Limiting by date


ninedoors

Recommended Posts

Here is the code I tried using.

 

$today = date("Y-m-d");
$query  = "SELECT hometeam, visitingteam, date, showdate, time FROM schedule WHERE date >= '$today' ORDER BY gamenumber LIMIT 0, 20";
$result = mysql_query($query);
$result1 = mysql_fetch_assoc($result);
print_r($result1);

 

The reason I am trying to echo the gamenumber was to make sure that it was working.  All I get is the first row in the DB when I run this query.  The date column in my database has the format 2007-09-22(YYYY-MM-DD).  I'm not sure if this is the problem or it is something else.  What I want to achieve here is to take the date the user looks at the webpage and give him the next 20 games on my schedule.  If you need anything else let me know.  Thanks in advance.

 

Nick

Link to comment
https://forums.phpfreaks.com/topic/70279-solved-limiting-by-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.