Forum Moderators: coopster

Message Too Old, No Replies

Echo Certain Values Only

         

inveni0

6:35 pm on Dec 31, 2005 (gmt 0)

10+ Year Member



I'm creating a table that has 7 columns. In the first column, I'd like to show My_SQL data. The data contains multiple fields, but there is one that matters most right now.

Right now, I show this data with:

<?php echo $row_UserData['Number'];?>

However, I only want to echo this value if another value of the same row ($row_UserData['Code']) equals a certain number.

How would I write a conditional statement like this?

sonjay

7:59 pm on Dec 31, 2005 (gmt 0)

10+ Year Member




if ($row_UserData['Code'] == 'yourtestvalue') {
echo $row_UserData['Number'];
}