bhazzard Posted February 2, 2006 Share Posted February 2, 2006 Alright I am learning to code php, and I just got to using the AND operator in If statements... this worked until I added the AND operator. What am I doing wrong? <?php if (date(G) >= 4) AND (date(G) <= 12) { echo "Good Morking"; }; if (date(G) > 12) AND (date(G) <= 15) { echo "Good Afternoon"; }; if (date(G) > 15) AND (date(G) <= 18) { echo "Good Evening"; }; if (date(G) > 18) AND (date(G) <= 24) { echo "Good Night"; }; if (date(G) >= 1) AND (date(G) < 4) { echo "Up Late?"; };?> Thanks a lot. Link to comment Share on other sites More sharing options...
_underscore_ Posted February 2, 2006 Share Posted February 2, 2006 Replace all instances of AND in those if() statements with "&&". Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now