I have the following class with the methods:
<?
class minhaClasse extends database {
public function funcao ($iduser) {
$date = array($iduser, '1');
$sql = "SELECT * FROM 'tabela' WHERE 'iduser' = ? AND 'princ' = ? ";
$result = parent::selectDB($sql, $date);
if (count($result) == 0) {return 0;} else {
foreach($result as $r) {
$return = $r->id;
}
}
return $return;
}
}
?>
In my main file I have the following functionality
<?
$minhaClasse = new minhaClasse;
$id = $minhaClasse->funcao($idUser); // *
if ($id == 0) {
echo "wem result";
} else {echo $id; }
?>
Good but with no echo I have the following return Array ( [0] => 00000 [1] => [2] => )
Even though it did or did not work in sql.
I was analyzing the code and saw that the line that causes the problem is a *.
The class datebase is ok because I use several other functions with it ...
How could I fix it?