我有问题的代码:
function get_installed_languages()
{
global $sql;
$languages = Array();
$sql->query("SELECT short_name FROM languages ORDER BY short_name");
if($sql->getNumRows()==1)
{
$languages[0] = "default";
return $languages;
}
else
{
for ($i=0; $i<$sql->getNumRows(); $i++)
{
$get = $sql->getRow($i);
if(trim($get['short_name'])=='')
$languages[$i]='default';
else
$languages[$i] = strtolower($get['short_name']);
}
return $languages;
}
}
它总是返回:
Fatal error: Call to a member function query() on a non-object
有问题的行是:
(742): $sql->query("SELECT short_name FROM languages ORDER BY short_name");
这是完整的文件。