Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
MySQL Query Help for Newbie
Old 06-08-2005, 04:48 PM MySQL Query Help for Newbie
Average Talker

Posts: 15
Trades: 0
I'm new to MySQL and I need help writing a query.

I have a table with fields for:

- FirstName
- MiddleName
- LastName
- BirthDay
- BirthMonth
- Birthyear

I want to query the database for all those whose BirthMonth is equal to the currentMonth and whose BirthDay is greater than or equal to the currentDay.

Basically...
BirthMonth == currentMonth AND BirthDay >= currentDay

How would I write this as a MySQL query?

- J2
jacannon2 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-08-2005, 05:11 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
PHP Code:
// Determine the date and month
$day date"j" );
$month date"m" );

$sql "SELECT * from theTable WHERE BirthMonth = $month AND BirthDay >= $day"
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 06-08-2005, 05:47 PM
Average Talker

Posts: 15
Trades: 0
Thanks. :-)

- J2
jacannon2 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to MySQL Query Help for Newbie
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26456 seconds with 12 queries