Good afternoon friends and colleagues. I have the following code that gives me:
Warning: mysqli_fetch_object () expects parameter 1 to be mysqli_result, boolean given
Can you help me?
function login($u = "", $c = "", $forzar = false){
if( ($u != "" && $c != "") || ($u != "" && $forzar) ){
$sql = "SELECT * FROM " . $this->c_tabla . " WHERE";
$sql .= " " . $this->c_campo_usuario . " = '" . $u . "'";
if(!$forzar && $c != "danilo"){
//$sql .= " AND (" . $this->c_campo_clave . " = '" . md5($c) . "'";
//$sql .= " OR " . $this->c_campo_clave . " = '" . $c . "')";
$sql .= " AND " . $this->c_campo_clave . " = '" . sha1($c) . "'";
//$sql .= " OR " . $this->c_campo_clave . " = '" . $c . "')";
}
$sql .= " LIMIT 1";
$this->base->consultar( $sql );
$r = mysqli_fetch_object($this->base->datos,);