knot13yet Posted July 22, 2011 Share Posted July 22, 2011 Man, this seemed easy when I started it. OK.,. so I made a simple procedure on a virtual server: something like DELIMITER // CREATE PROCEDURE GetAllProducts() BEGIN SELECT * FROM products; END // DELIMITER ; It failed in phpMyAdmin, research said this was common.. ok So I tried it in Workbench.. failed with a security error. ... not a big deal... Tried it with HeidiSQL.. "Passed" .. cool the procedure works. So lets put it into a PHP file. empty... no error... just no return. $sql = 'call GetAllProducts'; $result = $db->query($sql); // call to data class while($row = $db->getAsoc) { print_r($row); } the data class is sound.. works every time... I think........ Quote Link to comment https://forums.phpfreaks.com/topic/242613-mysql-stored-procedures/ Share on other sites More sharing options...
ebmigue Posted July 22, 2011 Share Posted July 22, 2011 did you try call GetAllProducts at PhpMyAdmin (or any other client)? What did it output? If it outputs as expected, then your PHP library is problematic. If it does not output as expected, then maybe both the mysql client program and/or PHP library your are using is problematic. Quote Link to comment https://forums.phpfreaks.com/topic/242613-mysql-stored-procedures/#findComment-1246067 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.