corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP / MySQL help needed!


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author PHP / MySQL help needed!
Nismo
Member

Registered: 12th Sep 02
User status: Offline
2nd Jun 09 at 10:00   View User's Profile U2U Member Reply With Quote

Im trying to return table entries where the input date matches todays date.

The entry goes in with NOW() so the date entry looks like (2009-06-02 10:25:36)

Then i have a table that i want to return all todays entries only so i need CURDATE() to match only.

Trying to work something along the lines of:

code:
$query="SELECT * FROM telesales WHERE inputdate LIKE '%CURDATE()%'";


this is not right but im sure its something along these lines.

AndyKent
Member

Registered: 3rd Sep 05
User status: Offline
2nd Jun 09 at 12:14   View User's Profile U2U Member Reply With Quote

I've managed to do this before by using DATEFORMAT() on the column, but I'm sure theres a better way....
Nismo
Member

Registered: 12th Sep 02
User status: Offline
2nd Jun 09 at 13:55   View User's Profile U2U Member Reply With Quote

sorted!

code:
$query="SELECT * FROM telesales WHERE DATE(inputdate) = CURDATE()";

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Server Help Jodi_the_g Geek Day 7 1430
19th Jan 06 at 15:18
by Jodi_the_g
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP / MySQL help needed! 28 database queries in 0.0106869 seconds