Jump to content
Larry Ullman's Book Forums

Phpmyadmin And Stored Procedures


Recommended Posts

Hello all,

 

I am starting the stored procedures in chptr 8 and having difficulty testing them.

I have always used phpMyAdmin, but it seems that this might not be the best thing for working with stored procedures.

I can verify that the procedure exists with SELECT * FROM information_schema.routines;

but I cannot edit them through the phpMyAdmin interface.

 

Further, when I call a stored procedure to test it, I just get booted out of the ecommerce2 database and wind up on the phpMyAdmin homepage.

 

Any suggestions would be greatly appreciated.

 

phpMyAdmin Version information: 3.2.4

MySQL client version: 5.1.41

Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

Link to comment
Share on other sites

I primarily used the command line mysql client to test the procedures, although I think I created and edited them using phpMyAdmin. Some people experience problems with stored procedures in phpMyAdmin and others don't. It's not clear what the main difference is. Here's what I had written in a thread in the old forum (http://www.larryullm...ad.php?24,50607):

 

I don't know what version of phpMyAdmin I used previously as I just upgraded. I'm now using phpMyAdmin 3.2.5 with PHP 5.3.2 and MySQL 5.1.44. It's using the mysql PHP extension. This time I could call the stored procedures using either the SQL tab or the SQL popup, so long as I named the database--CALL ecommerce2.select_sale_items(1)--and so long as I DID NOT select the database in phpMyAdmin first. In other words, I had to be on the phpMyAdmin home page to start. Clearly, phpMyAdmin is inconsistent about how it deals with stored procedures.

Link to comment
Share on other sites

How is phpMyAdmin running, is it setup to use mysql OR mysqli?

 

Most phpMyAdmin's I have seen use mysql not mysqli. IF you are using a testing environment for the site then go into phpmyadmin's config file and tell it to use mysqli. IF you are on a hosted site where you have root access you can change the config file there too, though sadly if you are on shared hosting you are stuck with whatever they have it set to use.

 

That is only thing I can think of is it is mysql not mysqli. Sounds like a configuration issue or database issue of some kind if phpMyAdmin is running with mysqli.

  • Upvote 1
Link to comment
Share on other sites

How is phpMyAdmin running, is it setup to use mysql OR mysqli?

 

Most phpMyAdmin's I have seen use mysql not mysqli. IF you are using a testing environment for the site then go into phpmyadmin's config file and tell it to use mysqli. IF you are on a hosted site where you have root access you can change the config file there too, though sadly if you are on shared hosting you are stuck with whatever they have it set to use.

 

That is only thing I can think of is it is mysql not mysqli. Sounds like a configuration issue or database issue of some kind if phpMyAdmin is running with mysqli.

 

Thanks Terry,

I am just using my local host and it is running mysqli.

The procedures that I entered into the SQL command box are stored in the database, it is just that phpmyadmin doesn't recognize them at all. They don't show up on the main admin area with all the tables. You can't test them. You can't even tell that they are there unless you try to enter one again and it gives you an error that the procedure already exists. Or, if you run an information schema query it shows them, but you cannot edit them at all. I did a google search and found that it is a common, inconsistent problem. No clear solutions except using something other than phpmyadmin.... This is a shame, phpmyadmin is easy to learn and use.

Link to comment
Share on other sites

I primarily used the command line mysql client to test the procedures, although I think I created and edited them using phpMyAdmin. Some people experience problems with stored procedures in phpMyAdmin and others don't. It's not clear what the main difference is. Here's what I had written in a thread in the old forum (http://www.larryullm...ad.php?24,50607):

 

I don't know what version of phpMyAdmin I used previously as I just upgraded. I'm now using phpMyAdmin 3.2.5 with PHP 5.3.2 and MySQL 5.1.44. It's using the mysql PHP extension. This time I could call the stored procedures using either the SQL tab or the SQL popup, so long as I named the database--CALL ecommerce2.select_sale_items(1)--and so long as I DID NOT select the database in phpMyAdmin first. In other words, I had to be on the phpMyAdmin home page to start. Clearly, phpMyAdmin is inconsistent about how it deals with stored procedures.

 

Thanks Larry,

This is a good excuse to go back and learn to use the command line mysql client. phpMyAdmin is great for beginners, and I am going to miss using it as I go through this book, but I am sure there are other advantages to learning how to use mysql client.

 

I found that mysql client is covered in chapter 4 of your PHP6 And MySQL5 Quick Pro Guide. I am good to go.

Link to comment
Share on other sites

 Share

×
×
  • Create New...