php - Why does the count of an ADODB count result display differently on Virt. Dedic. Hosted site differently than other sites I've worked with? -
when not using symfony, use adodb querying databases. have of queries executed in file. each select statement accompanied select count statement , using binding parameters. make sure there count , if count zero, appropriate error message displayed. if there count greater zero, select statement performed. on hosting , other shared hosting sites, select count gives me value , use substr count, on client's virtual dedicated server w/plesk, weird happens. here example below:
$selectcountsql = "select count(*) thistable email = ? , pwdhash = ?"; $selectcountquery = $db->execute($selectcountsql,array($email,$pwdmashed)); $count = substr($selectcountquery,10);
on other clients' sites w/shared hosting, output of $count integer actual count of records. however, on client's site hosted on virtual dedicated hosting, when i:
- echo $selectcountquery variable, displays value count(*) 1 --e.g. if count of 1 record returned.
- echo $count variable, displays nothing.
- when chance $count substr($selectcountquery,5) , , echo word: object
- when print_r or dump values of $selectcountquery, array of many adodb variables.
do have idea may happening?
on server, ended changing way adodb manual says , result able eliminate of select count queries in queries file:
$selectsql = "select * thistable email = ? , pwdhash = ?"; $selectquery = $db->execute($selectsql,array($email,$pwdmashed)); $count = $selectquery->recordcount();
and works fine now.
Comments
Post a Comment