Page 1 of 1

If question - seems simple enough but I'm new to PHP...

Posted: Thu Sep 27, 2007 11:13 am
by izsmart
Hello,

I'm very new to PHP and could use some help...

I have tried a few ways to do this with no luck - it seems as though it should be simple to do. I have existing PHP code and need to modify it based on this:

In my database I have 3 columns - I need to call a different function based on if a value exists in COLUMN1, COLUMN2, or COLUMN3 - something to the effect of if a value exists in COLUMN1 then do this... if a value exists in COLUMN2, then do this... etc.

Your help is much appreciated.

Thank You

Posted: Thu Sep 27, 2007 11:28 am
by feyd
General concept:

Code: Select all

if (!empty($foo1))
{
  doSomething();
}
if (!empty($foo2))
{
  doSomethingElse();
}