NYCPHP Meetup

[nycphp-talk] mysqli prepared statements

William Klein willie at pdfsystems.com
Thu Jan 4 20:36:21 EST 2007


Sorry about the messed up code I cut and pasted it from the script.  Seems
the format got changed after I sent it, lines got stuck together, not sure
why. I didn't paste it that way.

But yes I was preparing the statements before the loop.  Regardless I have
two questions.  

Is there a way of seeing the last query when running a prepared statement?
I guess the problem is that mysqli_info doesn't give information about
select statements

Why would a result set with one element in it need to be in a while loop to
allow the next statement to execute?

Thanks for you attention and I'll figure out the pasting problem.  Trying to
avoid HTML email.

> -----Original Message-----
> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
> On Behalf Of Daniel Convissor
> Sent: Thursday, January 04, 2007 8:09 PM
> To: NYPHP Talk
> Subject: [php] Re: [nycphp-talk] mysqli prepared statements
> 
> On Thu, Jan 04, 2007 at 04:38:46PM -0500, William Klein wrote:
> 
> > This statement is in a while loop, which is why I was using prepared
> > statements to begin with.
> 
> You're preparing the statement before the loop, then only
> binding/executing on each loop, right?
> 
> 
> In your reply I see there's a "?" after "select":
> 
> > $statement2 = $dbi->prepare("select? date,
> > date_format(date ,' %b %d %y') as
> > dta from 1TrackUser where loginID = ? ORDER BY date");
> 
> Perhaps there's some messed up stuff in your query?
> 
> Also, the code you posted is a mess.  It looks like you wrote it in the
> email rather than copied it from a real test script.
> 
> To really debug an issue, especially if you're trying to get help
> debugging it, you need to boil down the issue to a few lines of code in an
> isolated test script that anyone can run.
> 
> --Dan
> 
> --
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>             data intensive web and database programming
>                 http://www.AnalysisAndSolutions.com/
>  4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
> 
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php





More information about the talk mailing list