Click here to Skip to main content
15,936,903 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
hello
i am try to update selected row using Stored Procedure but its not work weel

this is my sp

SQL
DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `spr_StdUpdate`(
			       IN STUDENT_ID INT
			      ,IN STUDENT_NAME VARCHAR(40)
			      ,IN STUDENT_ADDRESS VARCHAR(60)
			      ,IN STUDENT_MOBILE VARCHAR(20)
			      ,IN STUDENT_CLASS VARCHAR(20)
			      ,IN STUDENT_EMAIL VARCHAR(60)
							   )
BEGIN

UPDATE  students SET 
					        
				name=STUDENT_NAME,
				address=STUDENT_ADDRESS,
				mobile=STUDENT_MOBILE,
				class=STUDENT_CLASS,
				email=STUDENT_EMAIL


 WHERE 
                                ID=STUDENT_ID;
END



I Call it from php like this

    mysql_query("Call spr_StdUpdate('$name', '$address' ,'$mobile' ,'$class' ,'$email','$ID')")
   or die(mysql_error());


but its not work
Posted

1 solution

i solve it

the problem when i call sp on php must call it like this

PHP
mysql_query("Call spr_StdUpdate('$ID','$name', '$address' ,'$mobile' ,'$class' ,'$email')")
   or die(mysql_error());
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900