note 84116 deleted from function.mysql-fetch-assoc by tularis
| From: | tularis@php.net | Date: | Sat, 28 Jun 2008 22:46:13 +0000 |
| Subject: | note 84116 deleted from function.mysql-fetch-assoc by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140903@lists.php.net to get a copy of this message | ||
Note Submitter: code newbie
----
i was wondering if it is possible if you could use an array within the associative array. for
example:
$myArray[0] = "field1";
$myArray[1] = "field2";
$query= SELECT field1, field2 FROM SomeTable
$result = mysql_query($query) or die('crap');
$row = mysql_fetch_assoc($result;
$myResult = $row[$myArray[0]];
echo $myResult;