prepared statements in mysqli?

This is a discussion on prepared statements in mysqli? within the PHP Language forums, part of the PHP Programming Forums category; hello! mysqli in PHP5 comes with prepared statements functionality. However, without persistent connections or connection pooling in this code library, ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2005
Mark
 
Posts: n/a
Default prepared statements in mysqli?



hello!

mysqli in PHP5 comes with prepared statements functionality. However,
without persistent connections or connection pooling in this code
library, one has to ask: why bother?

are prepared statements 'remembered' by the server for a while between
connections, so that new connections can take advantage of them, or are
they really only useful for those pages/requests that are executing a
huge amount of DML in a single shot.


thanks!
mark.


Reply With Quote
  #2 (permalink)  
Old 04-20-2005
Gordon Burditt
 
Posts: n/a
Default Re: prepared statements in mysqli?

> mysqli in PHP5 comes with prepared statements functionality. However,
>without persistent connections or connection pooling in this code
>library, one has to ask: why bother?
>
> are prepared statements 'remembered' by the server for a while between
>connections, so that new connections can take advantage of them, or are
>they really only useful for those pages/requests that are executing a
>huge amount of DML in a single shot.


I believe that prepared statements come with implicit quoting for
substituted values, so you don't have to fill your code with calls
to addslashes(), or risk SQL errors (and maybe your site getting
hacked) when someone decides to put single quotes or other nasty
characters into a web form. This may prove to be useful even if
no prepared statement is ever used more than once.

Gordon L. Burditt
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0