Guys, hi. I have this fuctions:
function query_dp($sql){
$link = mysql_connect('localhost', $bd_id, $bd_pass);
mysql_select_db("$bd");
if (!$link) {
die('Could not connect: ' . mysql_error());
}
return mysql_query($sql) or die(mysql_error());
mysql_close($link);
}
?>
In the main program, when i try to do:
echo mysql_num_rows(query_db($sql));
I get as return
1
When I do not encapsulate that code in a function and use it directly to the main program, i get the number of rows fetched.
The function is not returning a Resource but a... integer? WTF?
Any help would be greatly appreciated!
Thanks!!