SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Threaded View

  1. #1
    SitePoint Enthusiast XploreR's Avatar
    Join Date
    May 2001
    Location
    Singapore
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why won't this sorting work?

    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);
    }

    }
    Last edited by XploreR; May 27, 2001 at 10:03.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •