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:

  1. echo $selectcountquery variable, displays value count(*) 1 --e.g. if count of 1 record returned.
  2. echo $count variable, displays nothing.
  3. when chance $count substr($selectcountquery,5) , , echo word: object
  4. 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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -