inserting with PHP or with stored procedure
Posted: Tue Sep 12, 2006 10:24 pm
Greets,
i'm having bit of dillema when it comes to manipulating db lately
Usually, php code looks like this
With my current project I'm able to use stored procedures etc and started passing parameters to SP and let the SP handle the rest of it,
and the stored procedure takes care of insertion etc. This of course assume that the input is sanitized etc.
I'm just curious over any advantages/disadvantages anyone can see/have experienced with this approach etc.
Regards!
i'm having bit of dillema when it comes to manipulating db lately
Usually, php code looks like this
Code: Select all
$db->execute( 'INSERT INTO TABLE( ROW, ROW2, ROW3 ) VALUES( $VAL, $VAL, $VAL );Code: Select all
$db->execute( 'SELECT STOR_PROC( $VAL, $VAL, $VAL ) );I'm just curious over any advantages/disadvantages anyone can see/have experienced with this approach etc.
Regards!