Skip to content

Tag: stored-procedures

PHP get return value of stored procedure

I have pleasure to work with legacy PHP application using SQL Server via PDO. How in PHP can I retrieve return value of stored procedure which is using RETURN statement as output channel? Example procedure If possible, I would prefer to not modify procedure. I am aware that there are similar questions, but th…

MySQL 5.7 equivalent to PHP’s json_decode()?

I’m converting some php scripts into mysql stored procedures and have come across the usage of php’s json_decode() on a result set’s data. It occurs on a field which is stored as a mediumtext,utf8,utf8_unicode_ci How can I perform the ‘json_decode()’ process using pure MySQL? Sam…

Using pdo in php with stored procedure

I have a simple stored procedure in MySQL database: When calling this procedure in mysql-workbench it returns the data I put in: Now when I call it from PHP using pdo I get an error: Here is my php code: Answer You need to use bindValue instead of bindParam. When you use bindParam, it binds the variable provi…