Page 1 of 1

Stored Procedures- Getting started

Posted: Wed Dec 17, 2008 6:09 am
by fuzzyfuzz
Hi!
I'm starting to use the SP in my DB. thus, I have some questions about it:

1.I'm using WAMPSERVER- How can I access the storedProcedures from phpmyadmin?
or how can i accsess the SP I wrote at all?

2. Where do i write the SP? in php script or in the console?


This is my code- I wrote it in the php script but it doesn't work

Code: Select all

 
 
<?php
$mysql_link= mysql_connect('localhost','root','') or die("ERROR:cannot 
 
connect");
echo "connected successfully to MySQL server.";
 
mysql_select_db('pets',$mysql_link) or die ("could not open db".mysql_error());
echo "connected successfully to pets.";
DELIMITER //
CREATE PROCEDURE InsertData(IN Bname varchar(10) )
BEGIN
INSERT INTO exprience (BookNname)
VALUES (Bname);
END //
DELIMITER ;
 
CALL InsertData ('Oliver Twist');
mysql_close($mysql_link);
 
?>
 
 
Need your help!

Re: Stored Procedures- Getting started

Posted: Wed Dec 17, 2008 9:16 am
by VladSun
You need to create the stored procedure once - in MySQL console or in a SQL query in PHP admin.
Then read this:
viewtopic.php?f=2&t=81689

Re: Stored Procedures- Getting started

Posted: Fri Dec 26, 2008 4:45 am
by eskio
Hi,

to create stored procedure, use MySQL console or you can download the MySQL administrator (client program) from http://dev.mysql.com/downloads/gui-tools/5.0.html