Problem running some code
Posted: Fri Jun 08, 2007 8:42 am
I am new to PHP and I am having a small problem and I hope someone can help me with this. OK here is my problem and I am sure someone will see the wickedness of my bad coding.
When I run the code below it does return a result but not the one I want. Instead of returning the row with a status of 1 it is returning the row with the status of 0. What am I doing wrong?
Thanks in advance for any and all help on this.
When I run the code below it does return a result but not the one I want. Instead of returning the row with a status of 1 it is returning the row with the status of 0. What am I doing wrong?
Thanks in advance for any and all help on this.
Code: Select all
mysql_fetch_array($result);
while ($row = mysql_fetch_array($result)) {
if($row['status']=1) {
echo "<table>";
echo "<tr>";
echo "<td><h6>$row[subject]</h6>";
echo "<p class='small'>$row[date]</p>";
echo "<br /><p class='med'>$row[content]</p>";
echo "<br /><p class='small'>$row[author]</p></td>";
echo "</tr>";
echo "</table>";
}
}
mysql_close($con);