Marc Greenstock wrote:

I have a table with all the star signs, in the table are the fields
'Name','From','To'. Both the 'From' and 'To' are an integer of the relevant
dates eg in the 'Gemini' row I have:

Gemini, 521, 621 (521 means May 21st, 621 means June 21st). I hope I'm
explaining my self ok.

You should use a regular date column for your "from" and "to" dates.


Now in the users table I have date of birth stored in the Date format eg;
1979-06-20.

Here is my current stab at this.

SELECT * FROM users
WHERE MONTH(user_data.User_DOB) >= 5
AND DAYOFMONTH(user_data.User_DOB) >= 21
AND MONTH(user_data.User_DOB) <= 6
AND DAYOFMONTH(user_data.User_DOB) <= 21

and then you can do something like this:


WHERE DAYOFYEAR(user_data.User_DOB) BETWEEN DAYOFYEAR(startable.from) AND DAYOFYEAR(startable.to)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to