The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

hehe, I think I helped XploreR write some of this code, including th ksort($games). The reason for the ksort is that XploreR is essentially creating a UNION of two tables in the database by putting the results of two SQL queries into the one array and then sorting the array. This could have been done in the SQL if MySQL supported UNION.

However, thats about all I remember. As Skunk has alluded to the best way to tackle this it to go back to the original SQL commands and code used to create array $games. If we fiddle with the code here we can come up with a way of getting all the data you require into the array $games. What I'm thinking of is making $games a two-dimensional array. Each element will have a key being the name of the game, and a value which will be an array of all the other data you want to display about the game.

If you could post the relevent code I'm sure someone will be able to give more assistance.

But i think that there's gotta be a better way to do that. i think my code is quite bad tho, the key and val part are useless here? And i removed the ksort statement because it won't work in my coding as i want the games by alpha order. Perhaps some help here will be greatly appreciated.
And how do i do it in mulit array? I'm sure it'll look better but i don't know how

Basically what i want do to is still the same, i have lots of tables and i want to generate a page where all the tables with (example) column Alpha=A to show up. I have the url included too as the values. And then they will be sorted in order by the alpha. it was done via ksort the last time.
Now i would like more data to be shown but the sorting remains, that is by the game names

/*
* Due to compatibility problems with Table we changed the behavior
* of metadata();
* depending on $full, metadata returns the following values:
*
* - full is false (default):
* $result[]:
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
*
* - full is true
* $result[]:
* ["num_fields"] number of metadata records
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
* ["meta"][field name] index of field named "field name"
* The last one is used, if you have a field name, but no index.
* Test: if (isset($result['meta']['myfield'])) { ...
*/

// if no $table specified, assume that we are working with a query
// result
if ($table) {
$this->connect();
$id = @mysql_list_fields($this->Database, $table);
if (!$id)
$this->halt("Metadata query failed.");
} else {
$id = $this->Query_ID;
if (!$id)
$this->halt("No query specified.");
}