Stumped: MySQL only returning 1/2 results with *?
Posted: Sat Nov 25, 2006 12:58 pm
Hello All,
Well I am quite stumped on this function which does not seem to want to work. Im trying to pull the contents into an array
MySQL:
------------------------
`config_name`
`config_value`
PHP:
-------------------------
(array) $config['config_name'] = $config_value;
The problem is, using this function
And a print_r, I get this: multipart/x-zip;multipart/x-gzip [max_file_size] => 2MB [paypal_addr] => )
Which shows its not complete (as in the first value does not have a key and it doesnt have an opening parentheses
Im stumped, anyone have a clue?
Thanks
Well I am quite stumped on this function which does not seem to want to work. Im trying to pull the contents into an array
MySQL:
------------------------
`config_name`
`config_value`
PHP:
-------------------------
(array) $config['config_name'] = $config_value;
The problem is, using this function
Code: Select all
function loadConfig() {
$sql = mysql_query("SELECT * FROM `config`");
$config = array();
while ($row = mysql_fetch_array($sql)) {
$config[$row['config_name']] = $row['config_value'];
}
mysql_free_result($sql);
return $config;
}Which shows its not complete (as in the first value does not have a key and it doesnt have an opening parentheses
Im stumped, anyone have a clue?
Thanks