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? Quote Link to comment 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. Quote Link to comment 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'; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.