- Forums
- PHP
- Helpful Database TIps: How To Make Mysql Query Into Array
This Page Contains information about Helpful Database TIps: How To Make Mysql Query Into Array By wallpaperama in category PHP with 0 Replies. [1152], Last Updated: Sat May 18, 2024
wallpaperama
Sat Apr 26, 2008
0 Comments
1096 Visits
i often use this handy sql query to make my queries from mysql database into an array like this:
$config = array();
$sql = "SELECT config_name, config_desc,config_value FROM ".$db_prefix."config";
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($result)) {
do {
$config[$myrow['config_name']] = $myrow['config_value'];
} while ($myrow = mysql_fetch_array($result));
} else {
PageError ('ALERT: 12 There was an error with your request');
}