using a script to start a stored procedure and assigning a v

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
fuzzyfuzz
Forum Newbie
Posts: 10
Joined: Fri Dec 05, 2008 5:07 pm

using a script to start a stored procedure and assigning a v

Post by fuzzyfuzz »

hello, i've created a stored procedure that looks like so:

Code: Select all

 
DELIMITER $$
 
DROP PROCEDURE IF EXISTS `yoyo`.`ShowNames` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ShowNames`(IN Bname varchar(10) )
BEGIN
INSERT INTO jeta (BookNname)
VALUES (Bname);
END $$
 
DELIMITER ;
 
and a php script to trigger it that looks like so:

Code: Select all

 
<?php$mysql_link= mysql_connect('localhost','root','********') or die("ERROR:cannot connect");echo "connected successfully to MySQL server.";mysql_select_db('yoyo',$mysql_link) or die ("could not open db".mysql_error());echo "connected successfully.";$sql = "CALL ShowNames('daniel')";echo"SP used";mysql_close($mysql_link);?>
 
but when i start the script i do not see any change in my "jeta" table, which makes me kind of doleful. so do oblige my fellow developers. 10x.
FrancisC
Forum Newbie
Posts: 2
Joined: Fri Dec 19, 2008 2:18 pm

Re: using a script to start a stored procedure and assigning a v

Post by FrancisC »

I don't work with MySQL that much, but could it be as simple as committing the insert? It's often done by default, but maybe not in your case.
Post Reply