Really I am a PHP beginner, I am working on this code and I need help, kinda stuck.
I have a database with 3 fields(id, date and venue). This is simply what I want to do;
I want my script to go into the database fetch the date and compare it with a declared date(todays date) and if both days are equal, it should echo out the venue that corresponds to the date taken from Mysql.
Recommended Answers
Jump to PostHi
First you must have a valid date field in your table structure.
SELECT venue FROM tablename WHERE date_column = curdate()
Jump to PostHi aMOEBa
Your doing it incorrectly. ;)
Jump to PostThis should work:
$query = "Select venue from programOutline where `date` = '$curDate'";
If you're only interested in today, this works too:
$query = "Select venue from programOutline where `date` = CURDATE()";
All 11 Replies
ivatanako
1
Junior Poster
aMOEBa
commented:
He is great.
+1
aMOEBa
0
Light Poster
almostbob
866
Retired: passive income ROCKS
aMOEBa
0
Light Poster
ivatanako
1
Junior Poster
pritaeas
2,130
¯\_(ツ)_/¯
Moderator
Featured Poster
aMOEBa
0
Light Poster
aMOEBa
0
Light Poster
aMOEBa
0
Light Poster
almostbob
866
Retired: passive income ROCKS
aMOEBa
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.