[phplib] Why won't this sorting work? From: Kim (kstok <email protected>)
Date: 05/27/01

Hi. I have problems sorting. Can anyone help me? My output is correct just that the sorting dosen't work, which i want it to be in alphabetical order by the name of Game (column - Game). I'm using this with PHPLib Template and PHPLib dB class

Code:

$tables = array("PlaystationAction", "PlaystationAdventure", "PlaystationFighting", "PlaystationPlatform", "PlaystationPuzzle", "PlaystationRacing", "PlaystationRpg", "PlaystationSimulation", "PlaystationSports", "PlaystationStrategy");

foreach ($tables AS $table) {

$sql = "SELECT Alpha, Game, Url, Date, Publisher, Developer FROM $table
WHERE Alpha='a' ORDER BY Game ASC";

$db->query($sql);

while ($db->next_record()) {

$Alpha = $db->f(Alpha);
$Game = $db->f(Game);
$Url = $db->f(Url);
$Date = $db->f(Date);
$Publisher = $db->f(Publisher);
$Developer = $db->f(Developer);

$color = ($i++ % 2 ) ? '#000000' : '#333333';

$tmp3 = "<tr bgcolor='$color'><td><a href='/$Alpha/$Url/index.phtml'>$Game</a></td><td>$Publisher</td><td>$Developer</td><td>$Date</td></tr>";
$t->set_var('data', $tmp3);
$t->parse('DBlock', 'DataBlock', true);
}

}