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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.