Good evening
I'm in the process of starting an arabian raceform website, and was hoping someone could point me in the right direction with the error below.
I've attempted to code an if/else statement so that if there is nothing in the distance beaten column (i.e. horses who have won or failed to complete their race), the cell remains empty. If there is a figure included in this coulmn, and 'l' is tagged onto the end of the figure. The code below is resulting in a blank white page, and I wondered if someone could point out my goof that's causing it?
<?php
<h1>allahmes</h1>
</br>
// Get all the data from the table
$result = mysql_query(" SELECT runners.raceid, runners.horse, runners.weight, runners.overw, runners.rat, runners.eqp, runners.pos, runners.beat,
runners.jockey,
race.raceid, race.link, race.dateshort, race.cshort, race.classshort, race.distf, race.ground, race.racetype,
race.run
FROM runners
Inner Join race On
runners.raceid = race.raceid
WHERE runners.horse = 'allahmes'
ORDER BY runners.raceid DESC")
or die(mysql_error());
echo "<table>";
echo "<tr class='toprow'>
<th>Date</th> <th>Course</th> <th>Class</th> <th>Dist</th> <th>Going</th> <th>Race Type</th> <th>Weight</th> <th>Rat</th> <th>Eqp</th>
<th>Result</th> <th>Beaten</th> <th>Jockey</th></tr>";
// Keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
include($_SERVER['DOCUMENT_ROOT'].'/site/test/includes/links.php');
// Print out the contents of each row into a table
If ($row['beat'] == " ") {
echo "<tr>";
echo "<td>"; echo $row['dateshort'];
echo "</td><td>"; echo titleCase($row['cshort']);
echo "</td><td>"; echo strtoupper($row['classshort']);
echo "</td><td>"; echo $row['distf'];
echo "</td><td>"; echo titleCase($row['ground']);
echo "</td><td>"; titleCase($row['racetype']);
echo "</td><td>"; echo $row['weight']; echo " "; echo $row['overw'];
echo "</td><td>"; echo $row['rat'];
echo "</td><td>"; echo $row['eqp'];
echo "</td><td>"; echo $row['pos']; echo "/"; echo $row['run'];
echo "</td><td>"; echo $row['beat']; echo " ";
echo "</td><td>"; titleCase($row['jockey']);
echo "</td></tr>";
}
else
{
echo "<tr>";
echo "<td>"; echo $row['dateshort'];
echo "</td><td>"; echo titleCase($row['cshort']);
echo "</td><td>"; echo strtoupper($row['classshort']);
echo "</td><td>"; echo $row['distf'];
echo "</td><td>"; echo titleCase($row['ground']);
echo "</td><td>"; echo titleCase($row['racetype']);
echo "</td><td>"; echo $row['weight']; echo " "; echo $row['overw'];
echo "</td><td>"; echo $row['rat'];
echo "</td><td>"; echo $row['eqp'];
echo "</td><td>"; echo $row['pos']; echo "/"; echo $row['run'];
echo "</td><td>"; echo $row['beat']; echo "l";
echo "</td><td>"; titleCase($row['jockey']);
echo "</td></tr>";
}
echo "</td></tr>";
}
echo "</table>";
?>
Any information would be gratefully received.