kendallkamikaze Posted December 18, 2008 Share Posted December 18, 2008 I've been using $sql="SELECT * FROM horsedata WHERE id='$thehorse' and DOB < 36"; which works, but i need it so people cant enter their horse if its under the age of 2. So something like 2-36: $sql="SELECT * FROM horsedata WHERE id='$thehorse' and DOB 2-36"; I know that wont work, what code would i need for that? Link to comment https://forums.phpfreaks.com/topic/137461-php-numbersneed-dob-between-3-36/ Share on other sites More sharing options...
Jabop Posted December 18, 2008 Share Posted December 18, 2008 <?php $sql='SELECT * FROM horsedata WHERE id='$thehorse' AND DOB > 2 AND DOB <= 36'; ?> This would be more suited for the SQL forum by the way. Link to comment https://forums.phpfreaks.com/topic/137461-php-numbersneed-dob-between-3-36/#findComment-718345 Share on other sites More sharing options...
twm Posted December 18, 2008 Share Posted December 18, 2008 <?php $sql='SELECT * FROM horsedata WHERE id='.$thehorse.' AND DOB BETWEEN 3 AND 36'; ?> Link to comment https://forums.phpfreaks.com/topic/137461-php-numbersneed-dob-between-3-36/#findComment-718378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.