Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Selecting by date

Codes here !

Moderators: macek, egami, gesf

Selecting by date

Postby Joel » Wed Apr 02, 2003 9:43 pm

I want to have information inputted of when shows are going to be, using the date type field in mysql, and I want to be able to select what shows to get by saying anything older than 3 days old wont show. this is my current code...

mysql_query("SELECT `date` , `bands` , `venue` , `other` FROM shows WHERE `date` >= $today"


But with that it gives me anything in the table. If i make the where say...

WHERE `date` <= $today


I get nothing out. I also want to sort the date by date.
Joel
New php-forum User
New php-forum User
 
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand

Postby Romantik » Fri Apr 04, 2003 12:08 am

WHERE `date` <= '$today'
or
WHERE `date` <= now()
Romantik
New php-forum User
New php-forum User
 
Posts: 67
Joined: Mon Feb 24, 2003 2:55 am
Location: ../Ukraine/Kherson

Postby Joel » Fri Apr 04, 2003 3:05 pm

wicked, that works.

if (me=mysql + php)
{ happy; }
else
{ sad; }
Joel
New php-forum User
New php-forum User
 
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron