Hi effigy,
Thank you for your reply. I have had a look at the link you posted. As you said I would prefer to use mysqli. When you said, "pass a MySQL variable as the OUT parameteter--@out, for example--and then run SELECT @out." Did you mean I should do something like:
$db->query("call emailCount('$mail', '@out')") ;
$result = $db->query("Select @out") ;
I assume then I would need to process the $result variable to retrieve the @out value?
If i do it this way using mysql variable. If two different scripts were to call this stored procedure emailCount(..) will there be two mysql variable called 'out' or would both scripts used the same 'out' variable?
if I was to do it as a stored function would I do it like this?
$result = $db->query("SELECT same_addr_cnt('email')") ;
Then process the $result variable?
I know that stored procedures and stored function differ in the sense that:
- stored function can return a value whereas stored procedures can not.
- all parameters to stored functions can only be input parameters.
Is there any performance of security issue between stored procedures and stored functions that I should be aware of?
Once again thank you for your time.
Best regards,
Duniya.