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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
izsmart
Forum Newbie
Posts: 1
Joined: Thu Sep 27, 2007 10:59 am

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

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

General concept:

Code: Select all

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