HI,
I'm trying to make a script that calls data from a mysql database and display it in PHP. I have that working but I would like to order the data on the page by vehiclename. Please find below a copy of my script:
<?php if (!eregi("modules.php", $PHP_SELF))
{ die ("You can't access this rows directly..."); }
$index = 0; require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
opentable();
echo "<table>"
."<tr>"
."<td width=\"83%\">"
.""._TITLE."</td>"
."<td align=\"right\"></td>"
."</tr>"
."</table>";
closetable();
opentable();
echo "<br>";
$resultpersons = sql_query("SELECT vehicleid, vehiclename, vehicledesc, vehiclepos, vehiclepic, vehiclespeed, vehiclehand, vehiclecorn FROM ".$prefix."_vehicles", $dbi);
for ($m=0; $m < sql_num_rows($resultpersons, $dbi);
$m++) { list($vehicleid, $vehiclename, $vehicledesc, $vehiclepos, $vehiclepic, $vehiclespeed, $vehiclehand, $vehiclecorn) = sql_fetch_row($resultpersons, $dbi);
echo"<table border=1 cellpadding=0 cellspacing=0 style=border-collapse:collapse collapse bordercolor=#111111 width=100%>"
. "<tr>"
. "<td width=100 rowspan=3 height=100><img src=modules/Vehicles/images/veh_$vehiclepic.gif></td>"
. "<td width=\"100%\" bgcolor=\"#FF9C00\">"
. "<b>"._VehicleName."</b>$vehiclename</td>"
. "</tr>"
. "<tr>"
. "<td bgcolor=#f4f4f4 width=617 height=46 colspan=\"2\">"
. "<table border=\"0\" width=\"100%\" height=\"100%\">"
. " <tr>"
. " <td width=\"100%\"><b>Speed: <img src=modules/Vehicles/images/stat_$vehiclespeed.gif></b></td>"
. " </tr>"
. " <tr>"
. " <td width=\"100%\"><b>Handling: <img src=modules/Vehicles/images/stat_$vehiclehand.gif></b></td>"
. " </tr>"
. " <tr>"
. " <td width=\"100%\"><b>Cornering: <img src=modules/Vehicles/images/stat_$vehiclecorn.gif></b></td>"
. " </tr>"
. " <tr>"
. " <td width=\"100%\">$vehicledesc</td>"
. " </tr>"
. "</table>"
. "</td>"
. "</tr>"
. "<tr>"
. "<td bgcolor=#ff9c00 height=10 colspan=\"2\"><b>"._VehiclePos."</b>$vehiclepos</td>"
. "</tr>"
. "</table></br>";
}
closetable();
include("footer.php");
?>
Thank you in advance,
Ikyikypdtong