Собствена сама проблема использую такой код:
<?
function smiles($string) {
$query = DB::$dbh -> query("SELECT * FROM `smiles` WHERE `smiles_cats`=?",array(1));
while($query = $query -> fetch()){
$string = str_replace($query['smiles_code'], '<img src="/images/smiles/' . $query['smiles_name'] . '" alt="' . $query['smiles_code'] . '" />', $string); }
if(is_admin()){
$query = DB::$dbh -> query("SELECT * FROM `smiles` WHERE `smiles_cats`=?",array(1));
while($query = $query -> fetch()){
$string = str_replace($query['smiles_code'], '<img src="/images/smiles2/' . $query['smiles_name'] . '" alt="' . $query['smiles_code'] . '" />', $string); }
}
return $string;
}
?>
Постоянно бьет такую ошибку
Fatal error: Call to a member function fetch() on a non-object in *func.php on line 264
В чем проблема?
Изменил: Николай (11.10.2012 / 12:04)