SorentoUltimate
09-17-2009, 07:30 AM
Hello, i writeing a new addon and i have a problem.
i try to load data from a ta table for an option but i cannot make it !!!!
Option Code
select:eval
require_once(DIR . '/includes/functions_colors.php');
$options = fetch_colors_options_array();_
functions_colors.php
<?php
error_reporting(E_ALL & ~E_NOTICE);
// ###################### Fetch Colors as Options #######################
// Return Colors Options Array
function fetch_colors_options_array()
{
global $vbulletin;
$out = array();
// fetch Colors
$getcolors = $db->query_read("
SELECT colorid, colorname
FROM `" . TABLE_PREFIX . "colors`
");
echo 'After Get';
while ($colorrow = $db->fetch_array($getcolors))
{
$out["$colorrow[colorid]"] = "$colorrow[colorname]";
}
return $out;
}
?>
_
Error :
Fatal error: Call to a member function on a non-object in /......./......./......./......./forum/includes/functions_colors.php on line 14
i try to load data from a ta table for an option but i cannot make it !!!!
Option Code
select:eval
require_once(DIR . '/includes/functions_colors.php');
$options = fetch_colors_options_array();_
functions_colors.php
<?php
error_reporting(E_ALL & ~E_NOTICE);
// ###################### Fetch Colors as Options #######################
// Return Colors Options Array
function fetch_colors_options_array()
{
global $vbulletin;
$out = array();
// fetch Colors
$getcolors = $db->query_read("
SELECT colorid, colorname
FROM `" . TABLE_PREFIX . "colors`
");
echo 'After Get';
while ($colorrow = $db->fetch_array($getcolors))
{
$out["$colorrow[colorid]"] = "$colorrow[colorname]";
}
return $out;
}
?>
_
Error :
Fatal error: Call to a member function on a non-object in /......./......./......./......./forum/includes/functions_colors.php on line 14