Jump to content

Recommended Posts

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........

 

:shrug:

 

Link to comment
https://forums.phpfreaks.com/topic/242613-mysql-stored-procedures/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.