Quote( $db->getEscaped( $search, true ), false ); }else{ echo('[err]标题不能为空[/err]'); exit; } if ($catid>0) { $where[] = ' catid = '.$catid; } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__content' . $where; $db->setQuery( $query ); $total = $db->loadResult(); if($total>0){ echo('[yes]'); }else{ echo('[no]'); } exit; ?>