Help - Search - Members - Calendar
Full Version: Help! Creating Mysql Stored Procedures!
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
ochho
This is a nightmare... I CANT USE PHPMYADMIN AT ALL.

Now, I was able to create and populate tables through PHP, but I have another problem. How do you create mySQL stored procedures through PHP?? It's not working.

Here is the syntax for the SQL query

$sql = "DELIMITER $$

DROP PROCEDURE IF EXISTS `prana_prana`.`catalog_get_categories_list`$$
CREATE DEFINER=`prana_admin`@`localhost` PROCEDURE `prana_prana`.`catalog_get_categories_list`()
BEGIN
SELECT category_id, en_name, fr_name FROM category ORDER BY category_id;
END $$"

And here is the error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$ DROP PROCEDURE IF EXISTS `prana_prana`.`catalog_get_categories_l' at line 1"

PLEASE HELP, IM GONNA GO INSANE!!!!!! It's been 2 days..trying to work around this phpmyadmin #$^$^&E
ochho
ok, so apparently "DELIMITER $$" cant be used inside a query from a php script.

So i fixed that..

but now im getting access denied?

"Access denied for user 'prana_admin'@'localhost' to database 'prana_prana'"

I checked the info, and everything is good.. database="prana_prana", username="prana_admin" domain="prana.uuuq.com"

Thanks for the help.
Ed
Resolved on IRC.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.