Strange result from empty table
| From: | George Pitcher | Date: | Fri, 10 Dec 2004 12:39:00 +0000 |
| Subject: | Strange result from empty table | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16157@lists.php.net to get a copy of this message | ||
Hi,
I'm getting a strange result querying an empty table (MySQL 4.0).
My code:
$strSQLc = "select count(id) from deposit_balance where
acc_id=".vr('Acc_ID')." order by id desc";
$count=$db->getOne($strSQLc);
echo "QUERY: $strSQLc<br>";
echo "COUNT: $count<br>";
produces:
QUERY: select count(id) from deposit_balance where acc_id=918 order by id
desc
COUNT: 1
It should give me a form in which I can enter details to create a record in
that table.
If I paste the query into my MySQL editor (MySQLFront) it shows '0' in the 1
cell returned.
Any ideas why this is giving me such a bum result?
Cheers
George in Oxford