I am new to arrays, and was thinking they could help me in my racing project. I have two pages, one displaying the data, and the other, currently used as a php include, that contains the array.
I can get the more simple elements of the array working, but I was hoping to have the array store some code to determine the number of winners and qualifers for each filter, along with the profit. THis is the element I'm struggling with.
Array:
<?php
$qualifiers_array[0] = "SELECT * FROM table WHERE trk is not null and WHERE tfr = \'1\'";
$qualifiers_array[1] = "SELECT * FROM table WHERE tfr=\'2\'";
$qualifiers_array[2] = "SELECT * FROM table WHERE tfr=\'3\'";
?>
Results page:
<?php include($_SERVER['DOCUMENT_ROOT'].'/*****/*****/*****/*****.php');?>
<?php
echo "<table border='1'>";
echo "<tr> <th>Filter Name</th> <th>Profit</th> <th>Winners</th> <th>Qualifiers</th> <th>%age</th></tr>";
echo "<tr>";
echo "<td width='20%'>". $name_array[0] . "</td>";
echo "<td width='20%'>". $profit_array[0] . "</td>";
echo "<td width='20%'> </td>";
echo "<td width='20%'>". $qualifiers_array[0] . "</td>";
echo "<td width='20%'> </td>";
echo "</tr>";
echo "<tr>";
echo "<td width='20%'>". $name_array[1] . "</td>";
echo "<td width='20%'>". $profit_array[1] . "</td>";
echo "<td width='20%'> </td>";
echo "<td width='20%'>". $qualifiers_array[1] . "</td>";
echo "<td width='20%'> </td>";
echo "</tr>";
echo "<tr>";
echo "<td width='20%'>". $name_array[2] . "</td>";
echo "<td width='20%'>". $profit_array[2] . "</td>";
echo "<td width='20%'> </td>";
echo "<td width='20%'>". $qualifiers_array[2] . "</td>";
echo "<td width='20%'> </td>";
echo "</tr>";
echo "</table>";
?>
The current result is: http://www.equinefocus.co.uk/random/4l56fdfm/menu/levelone.php
Could anyone steer me in the right direction? Any help is greatly appreciated.