Hi all,
Here is a section of my script:
<?
$row = mysql_fetch_row(mysql_query("SELECT COUNT() FROM categories WHERE CatParent = $id"));
if($row[0] > 0){
$result = mysql_query("SELECT FROM categories WHERE CatParent = $id AND active='yes' ORDER BY CatID");
while($row = mysql_fetch_array($result)){
if ( $row['description'] == "") {
echo "<TR>";
echo "<TD align=left vAlign=center width=\"29\"><a href=\"melb_index_test1.php?id={$row['CatID']}\"><IMG align=center alt=\"LET'S GO MELBOURNE\" border=0 height=19 src=\"melbourne_files/go.gif\" width=23></A>";
echo "</TD>";
echo "<TD align=left vAlign=center width=\"306\"><a href=\"melb_index_test1.php?id={$row['CatID']}\">{$row['CatName']}</a></TD>";
echo "<TD align=left vAlign=center width=\"100\">< Click to view</TD>";
echo "</TR>";
} else {
echo "<TABLE cellPadding=2 cellSpacing=0 width=435 border=1>";
echo "<TBODY><TR>";
echo "<TD align=left vAlign=center width=\"100%\" colspan=\"1\"><a href=\"melb_index_test1.php?id={$row['CatID']}\">{$row['CatName']}</a>";
echo "</TD>";
echo "</TR>";
echo "<TR>";
echo "<TD align=left bgColor=#f2f2f2 vAlign=center width=\"100%\" colspan=\"1\">{$row['description']}</TD>";
echo "</TR>";
}
}
} else {
<--more script here
My question is that every time i alter the table structure of the bottom else statement the one above it gets affected too.
I'm wondering if my else statement is incorrect.
Can anybody see a problem?
Cheers,
mick