(O/T) Some funky php coding I just did...
Posted: Tue 11 May 2010 1:12 am
Hi guys,
This is completely off-topic, but I thought you might perhaps appreciate/belittle a tiny bit of coding that I did for the No457 website:
And the usage:
Basically - it a whole heap of 'static' tables in MySQL pumped into one big multidimensional array. I've got to make a few different tweaks to it to get it 100% right, but the basics work just fine
What do you guys think?
This is completely off-topic, but I thought you might perhaps appreciate/belittle a tiny bit of coding that I did for the No457 website:
Code: Select all
foreach(array ("access" => null,"actions" => null,"badges" => null,"ranks" => null) as $key => $table) {
$query = mysql_query ( "SELECT * FROM `". $key ."`" );
while($results = mysql_fetch_assoc ( $query )) {
$static[$key][] = $results;
}
}
unset($table);
Code: Select all
echo $static['badges'][4]['long'];
What do you guys think?