Yes but, I'm are working with objetcs and my function resultado() is :
function resultado($q,$t) {
$res = mysql_query($q);
switch($t){
case 1:
return $res;
break;
case 2:
$array = mysql_num_rows($res);
return $array;
break;
}
}
This function are corret!
But my problema is this:
Example:
if($num == 0) {
$link =" <td>Nenhuma categoria foi adicionada</td>"; / / any category not to exist
return $link;
}
else {
$sel = $this->resultado (" SELECT * FROM phpdown_categorias ORDER BY name ASC",1);
while($res = mysql_fetch_object($sel)) {
$cat_id = $res->id;
$cat_nome = $res->nome;
$link =" <td><a href = \ " listar.php?cat=$cat_id \"> $cat_nome </a></td>";
return $link;
}
}
is function it is correct? is not she coming back any value, but all the variables are of local mark I only want her to come back $link but am not I getting, could anybody help me?