Posted: Thu Jun 09, 2005 7:33 pm
Hello, Brian.
Well, pardon for the word but your code is way too messed
. There are missing quotes (") here and there, wrong loop statement declaration, single-quote in place of double, missing scape character (\), etc. And these are the syntax errors only. There are also some logic errors: missing database querying and fetching functions (maybe they are few lines earlier in the code), variable mistype, etc.
I decided to start from the initial code, the one you started from too:
Note #1: The database must have to be 'initialized' (mysq_connect, mysq_select_db, query, etc) some point before this line. Since the initial code is fully functional as you said, we can assume that database setup and querying were made.
Note #2: I presume your code checks if at least 1 row was returned from DB before it shows this table. There might be some if (mysql_num_rows(... > 0) a few lines earlier in the code. If not, consider Syranide's recommendation about getting a NULL for the first loop.
Note #3: Setting background color for a <tr> only works if their <td> children have background color set to null.
I think this is it. If you still have problems I suggest you to post the entire code.
Hope it helps!
Falou,
Scorphus.
Well, pardon for the word but your code is way too messed
I decided to start from the initial code, the one you started from too:
Code: Select all
<table width="100%" border="1">
<tr>
<td><h2>250 Championship</h2></td>
</tr>
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td><h1>Name</h1></td>
<td><h1> </h1></td>
<td><h1>Cookstown</h1></td>
<td><h1>Tandragee</h1></td>
<td><h1>NW200</h1></td>
<td><h1>Athea</h1></td>
<td><h1>Skerries</h1></td>
<td><h1>Southern</h1></td>
<td><h1>Walderstown</h1></td>
<td><h1>Kells</h1></td>
<td><h1>Faugheen</h1></td>
<td><h1>Mid-Antrim</h1></td>
<td><h1>UGP </h1></td>
<td><h1>Killalane</h1></td>
<td><h1>Scarborough</h1></td>
<td><h1>Total</h1></td>
</tr><!-- Database might be 'initialized' some point above. Please read the note #1 below this code block -->
<?php do { // Please read note #2
$class = @($class == 'trOne') ? 'trTwo' : 'trOne';
?>
<tr class="<?php echo $class; ?>"> <!-- Please read note #3 -->
<td><p><?php echo $row_get250Results['f_name']; ?></p></td>
<td><p><?php echo $row_get250Results['l_name']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['cookstown']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['tandragee']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['northwest']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['athea']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['skerries']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['southern']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['walderstown']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['kells']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['faugheen']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['midantrim']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['ugp']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['killalane']; ?></p></td>
<td align="center" class="innerborder"><p><?php echo $row_get250Results['scarborough']; ?></p></td>
<td align="center"><p><?php echo $row_get250Results['TotalScore']; ?></p>
</td>
</tr>
<?php } while ($row_get250Results = mysql_fetch_assoc($get250Results)); ?>
</table>
</td>
</tr>
</table>Note #2: I presume your code checks if at least 1 row was returned from DB before it shows this table. There might be some if (mysql_num_rows(... > 0) a few lines earlier in the code. If not, consider Syranide's recommendation about getting a NULL for the first loop.
Note #3: Setting background color for a <tr> only works if their <td> children have background color set to null.
I think this is it. If you still have problems I suggest you to post the entire code.
Hope it helps!
Falou,
Scorphus.