If you have to assign 24 unique variables rather than storing this data in an array, then you could apply some variable variable action. Here is a code sample that assumes you are looping through a result set from a database:

query ="SELECT short_label FROM config ORDER BY meter_num";
$result= @MSSQL_QUERY($query)
or die("Can't connect or something painfully obscure");
while($row = mysql_fetch_assoc($result)) {

That will, I believe, give you a list of variables/values such as:
$short_label_1 = short_label_1
$short_label_2 = short_label_2

You can also adjust the variable name to your liking, such as:


The above should be correct, but I do admit that I don't use this technique daily.

To bad you cannot just throw your values into an associative array and pluck them when 
using $key => $value type of combinations.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to