I'm still learning PHP. Wondering if anyone could lend some thoughts on a small piece of code i'm trying to get working.
Within my PHP page I spit out some information, which works fine, but within one portion, I would like to display a certain value based on the records "status" field within my database. Pretty strait forward, but I cannot figure out the syntax to get this done.
Here is my call to grab my info from the database:
Code: Select all
$rs_recent = mysql_query("select * from PHPAUCTIONXL_letus where user_name = '".$_SESSION["user_name"]."' order by appraisalid desc") or die(mysql_error());Code: Select all
<? while ($prows = mysql_fetch_array($rs_recent)) {?>
<tr>
<td>#<? echo $prows['appraisalid'];?></td>
<td><? echo $prows['fname'].' '.$prows['lname'];?></td>
<td><? echo substr($prows['t_description'],0,50).'...';?></td>
<td><a href="completed_appraisal.php?appid=<? echo $prows['appraisalid'];?>">View</a></td>
</tr>
<? } ?>Code: Select all
<? while ($prows = mysql_fetch_array($rs_recent)) {?>
<tr>
<td>#<? echo $prows['appraisalid'];?></td>
<td><? echo $prows['fname'].' '.$prows['lname'];?></td>
<td><? echo substr($prows['t_description'],0,50).'...';?></td>
IF status='5' then display this:
<td><a href="completed_appraisal.php?appid=<? echo $prows['appraisalid'];?>">View</a></td>
else display this
<td>In progress</td>
</tr>
<? } ?>