[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

What is the correct code for this if statement?

Here's the if statemement that I'm using:

if($email_sent<>"0000-00-00")
{
do something
}
else
{
do another thing
}

It's not working correctly and I don't know why. When I print out the $email_sent variable, it comes back "0000-00-00." Yet, it just blows right past my if statement.

So, what do I need to do different? I need to write an if statement that effectively identifies those situations where the date field is 0000-00-00. Right now, what I have written isn't doing that and I don't know why.

Thoughts?
0
brucegust
Asked:
brucegust
  • 2
2 Solutions
 
Marco GasiFreelancerCommented:
Use != instead <>:

if($email_sent != "0000-00-00")
{
do something
}
else
{
do another thing
}
0
 
DaeltCommented:
not sure about the <> supported by php.

Maybe have a try with this :
if($email_sent != "0000-00-00")
{
do something
}
else
{
do another thing
}

Open in new window

0
 
DaeltCommented:
lol MarqusG was a bit quicker to answer ;)

Hope it works anyway
0
 
brucegustAuthor Commented:
Thanks, guys!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now