How do you write a Prepared Statement WITH a Stored procedur

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
websoft08
Forum Newbie
Posts: 5
Joined: Tue May 27, 2008 11:32 am

How do you write a Prepared Statement WITH a Stored procedur

Post by websoft08 »

All I do is read pros and cons for both prepared statements and stored procedures, what I want to do is combine the best of each by using

a) Prepared statements for their security against SQL Injection

b) Call a Stored Procedure for their increase in speed efficiency.

The problem is I have no idea how to combine them together & I don't see anything good on the web that answers this. Are you supposed to put the whole prepared statement into the stored procedure or are you supposed to write the stored procedure with all the fields and then use the prepared statement which calls the stored procedure and substitute the parameters with ? , ?, ? I can't figure it out!

Please someone give me an example of a Stored Procedure AND a Prepared Statement that calls that stored procedure.

Thanks!!!!
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: How do you write a Prepared Statement WITH a Stored procedur

Post by panic! »

try the databases forum :)
Post Reply