[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • 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
 
brucegustPHP DeveloperAuthor Commented:
Thanks, guys!
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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