Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-05 Thread Richard Quadling
On 5 November 2010 05:21, Tamara Temple tamouse.li...@gmail.com wrote: On Nov 4, 2010, at 6:36 AM, Jay Blanchard wrote: [snip] If you have a query in your PHP code, which you are going to be executing a lot, even if you are using prepared statements, you can go one further by creating a

[PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Tamara Temple
I'm wondering what the advantages/disadvantage of using prepared statements with mysqli are. I'm used to using the mysqli::query and mysqli::fetch_assoc functions to deal with retrieving data and bulding my sql statement in php code. Tamara Temple -- aka tamouse__

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Shreyas Agasthya
Tamara, In one of the earlier threads, it was mentioned mysqli APIs are more secure, faster, and actually maintained. Also, if you use some of the mysql_xxx(), you actually get a warning saying that it will be or it is being deprecated and paves the way for you to approach the same thing with

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Richard Quadling
On 4 November 2010 08:19, Shreyas Agasthya shreya...@gmail.com wrote: Tamara, In one of the earlier threads, it was mentioned mysqli APIs are more secure, faster, and actually maintained. Also, if you use some of the mysql_xxx(), you actually get a warning saying that it will be or it is

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Richard Quadling
On 4 November 2010 10:42, Richard Quadling rquadl...@gmail.com wrote: On 4 November 2010 08:19, Shreyas Agasthya shreya...@gmail.com wrote: Tamara, In one of the earlier threads, it was mentioned mysqli APIs are more secure, faster, and actually maintained. Also, if you use some of the

RE: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Jay Blanchard
[snip] If you have a query in your PHP code, which you are going to be executing a lot, even if you are using prepared statements, you can go one further by creating a stored procedure. Now the SQL server will only ever need to compile the statement once. No matter how many times it is used. You

RE: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Matt Graham
Jay Blanchard jblanch...@pocket.com didst scribe: using stored procedures has a lot of advantages. If you need to change your SQL you can do it in one spot. It reinforces MVS or modular coding behavior, the SP becomes very re-usable. Security is improved. Performance can be improved. You can

RE: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Jay Blanchard
[snip] Just don't go too far. [/snip] I absolutely agree! Doing SP's for SP sake is not desired and be truly careful about cascading the procedures. And always, ALWAYS document your code and put copious comments in the SP's. -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Alex Nikitin
One thing to remember is that dealing with results from prepared statements is different then getting results from queries, so if you are using both, confusion can easily set in (and lets face it, prepared statements arent always the best thing to use)... if its of any help, i have written a class

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread knl
On Thu, 4 Nov 2010 02:48:55 -0500 Tamara Temple tam...@tamaratemple.com wrote: I'm wondering what the advantages/disadvantage of using prepared statements with mysqli are. I'm used to using the mysqli::query and mysqli::fetch_assoc functions to deal with retrieving data and bulding my sql

Re: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Tamara Temple
On Nov 4, 2010, at 6:36 AM, Jay Blanchard wrote: [snip] If you have a query in your PHP code, which you are going to be executing a lot, even if you are using prepared statements, you can go one further by creating a stored procedure. Now the SQL server will only ever need to compile the