Forum Moderators: coopster

Message Too Old, No Replies

IF - How to use

         

piskie

11:30 am on Oct 12, 2006 (gmt 0)

10+ Year Member



I have a PHP page with repeated regions pulled from a MYSQL Table.

What I am struglink with is to make an IF work with 4 retrieved values.

I want the following 3 to display consecutively (no spaces) as they end up being a link (within a span for css purposes) with the 'code' being the query part of the URL:
<?php echo $row_D100LIST['pixlink1'];?>
<?php echo $row_D100LIST['code'];?>
<?php echo $row_D100LIST['pixlink2'];?>

But only when Yes is the returned value of:
<?php echo $row_D100LIST['displaypix'];?>

So we are looking at:
IF displaypix = 'Yes'............?

My coding skills are very limited so if someone could help me on this in a very basic and simple way, I would be very happy.

eelixduppy

11:32 am on Oct 12, 2006 (gmt 0)



Something like:

if($row_D100LIST['displaypix'] == "yes") {
//do something, in your case print the link
} else {
//do nothing, or print error message
}

Good luck :)

piskie

12:08 pm on Oct 12, 2006 (gmt 0)

10+ Year Member



Sorted.
Thanks very Much eelixduppy

eelixduppy

2:01 am on Oct 13, 2006 (gmt 0)



Glad you got it ;)