Jump to content

[SOLVED] If variable is null question


salinah20

Recommended Posts

I've been googling the net, and searching here, and all the answers I find seem to confuse me more than I was to start with.  I'm hoping some kind hearted soul here can put me on the right path.  For those have been coding PHP for a while this is probably a really easy question...

 

I have 2 variables (they're set from a mysql database and are working just fine) that I'm trying to do an if-then kinda thing on.  Something like:

 

If $subscriber is null and $ppl is not null then do this

If $ppl is null and $subscriber is not null then do this other thing

If $subscriber is null and $ppl is null then do nothing

 

I know how to fill in the "then do this" blank....what I can't seem to figure out is how to compare for "Is Null" or "Is Not Null" and put that in and If-Then-Else kinda thing.

 

Can anyone help me out here?

Link to comment
https://forums.phpfreaks.com/topic/84129-solved-if-variable-is-null-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.