query returns 0 when it shouldnt
| From: | bob pilly | Date: | Wed, 18 Feb 2004 08:01:59 +0000 |
| Subject: | query returns 0 when it shouldnt | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-178073@lists.php.net to get a copy of this message | ||
Hi All
Im having trouble with a query that runs fine when i
cut and paste it to freetds and run against the
database. code as follows:
$query ="select count(phonenum) from callrslt where
(dateofcall = '$today') and (callresultcode ='9' or
callresultcode ='12' or callresultcode ='14')";
$result=mssql_query($query,$numero);
$contacts=mssql_fetch_row($result);
print_r($contacts);
This returns
Array ( [0] => 0 )
select count(phonenum) from callrslt where (dateofcall
= 'Feb 17 2004') and (callresultcode ='9' or
callresultcode ='12' or callresultcode ='14')
If i cut and paste this to freetds i get a result of
5120. Can anyone spot why i am getting a zero with
php? There are no problems with any of my other
queries in my scripts.
Thanks in advance for any help.
Cheers
Bob
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html