NYCPHP Meetup

[nycphp-talk] mysqli prepared statements

willie klein willie at pdfsystems.com
Thu Jan 4 11:27:37 EST 2007


Hi All;

 

I just started using prepared statements.  So far I have been very
impressed by how much of a performance enhancement there is when using
them.  I have a query that isn't working now though and I'm not sure how
to troubleshoot it.  I used to just echo out the query and I could see
where the problem was.  I keep getting an empty result set from a query
I know should have data in it.  Is there a way to see the prepared query
as the server sees it?  I keep echoing out mysqli_error($dbi) but there
is nothing in it.  

 

Relevant Code:

$statement2 = $dbi->prepare("select  date, date_format(date ,' %b %d
%y') as dta from 1TrackUser where loginID = ? ORDER BY date");// if
(mysqli_error($dbi)) {

          echo "ERROR: ".mysqli_error($dbi)."<BR>"; } echo
"ShowroomLoginID = $ShowroomloginID<br>"; // something valid is here

$statement2->bind_param("s",$ShowroomloginID);        

$statement2->execute();

$statement2->bind_result($date,$dta);

$TotalLogin = $statement2->num_rows ; // always 0 when I run query
manually it works.

 

Thanks

Willie            

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070104/3960ab2a/attachment.html>


More information about the talk mailing list