MYSQL List Problem
Posted: Fri Jul 13, 2007 12:56 pm
The script below doesn't list the text from from the database correctly, unless I remove the 'if' statement
Code: Select all
mysql_select_db("news", $blog);
$result = mysql_query("SELECT * FROM news LIMIT 5");
while($row['cat'] = mysql_fetch_array($result))
{
if($row['cat'] == 'Blog')
{
echo "<t1><a href=\"blog.php\" target=\"_blank\" class=\"s1\">" . $row['title'] . "</a> <br /> </t1>";
}else{}
}
echo " <br /><a href=\"blog.php\" class=\"s1\">see more...</a> </td>
</tr>
</table>";
mysql_close($blog);