Nagtegaal
Member
Hi,
I try to CALL a Stored Procedure from the mysql database using the PHP Events list plugin. On the onPreloadData part I entered this script (among others):
try {
$myDb = JFactory::getDbo();
$sql = 'CALL sp_test()';
$result = $myDb->prepare($sql);
$result->execute();
} catch (Exception $e) {
}
But I get the error: Call to a member function execute() on null
I can CALL the SP in mysql without error. In the wiki PHP common tasks I find examples about insert and update, but not calling a SP. I kept the Store Procedure as simple as possible, without any IN or OUT parameters.
Any advice would be very welcome.
I try to CALL a Stored Procedure from the mysql database using the PHP Events list plugin. On the onPreloadData part I entered this script (among others):
try {
$myDb = JFactory::getDbo();
$sql = 'CALL sp_test()';
$result = $myDb->prepare($sql);
$result->execute();
} catch (Exception $e) {
}
But I get the error: Call to a member function execute() on null
I can CALL the SP in mysql without error. In the wiki PHP common tasks I find examples about insert and update, but not calling a SP. I kept the Store Procedure as simple as possible, without any IN or OUT parameters.
Any advice would be very welcome.