OK. I found out the answer myself, but I'll post it here in case it helps anyone else.
My code was like :
$result=mysql_query('SELECT COUNT(*) FROM urltbl');
then I just tried to echo $result; but it needs to be accessed like, for example,
while ($row=mysql_fetch_array($result)) {
echo $row;
}
...even though the result is only one row.