Código PHP:
public function sqlSelect($rows,$from,$where,$limit)
{
switch($limit) {
case '': $limit = 1; break;
case $limit>1: return $limit; break;
}
$this->select = mysql_query("SELECT ".$rows." FROM ".$from." WHERE ".$where." LIMIT '".$limit."'");
if($this->select) {
return $this->select;
} else {
return mysql_error();
}
return $this->select;
}
Código PHP:
$this->sqlSelect("campo1,campo2,campo3,campo4",
"campo5","campo6='2'","1");
$row = mysql_fetch_assoc($this->select);
if(mysql_num_rows($this->select) == 1) {
// .....
}
Código:
¿Cúal sería el error?.... ThanksWarning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ....\class.jugador.php on line 85 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ...\class.jugador.php on line 93
Nos vemos :)