Page 1 of 1

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

Posted: Sat Dec 20, 2008 12:02 pm
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.

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

Posted: Mon Dec 22, 2008 12:07 pm
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.