Questions about using PHP to call MYSQL stored procedures
Source: Internet
Author: User
The following code is used to call the MYSQL stored procedure in PHP: & lt ;? Php & nbsp; $ dbcon = mysql_connect (& quot; localhost & quot;, & quot; root & quot;, & quot; sony & quot ;) ordie (& q PHP call MYSQL stored procedure problem
The following code is used:
PHP:
$ Dbcon = mysql_connect ("localhost", "root", "sony") or die ("data cannot be connected ");
Mysql_select_db ("dbname") or die ("data cannot be connected". $ db );
Mysql_query ("call p_ss ()", $ dbcon) or die ("unable to connect ");
Mysql_close ($ dbcon );
?>
MYSQL:
Create definer = 'root' @ 'localhost' PROCEDURE 'p _ cong_ss '(in idd int)
BEGIN
Update bookuser
Set id = idd;
Select idd;
END
MYSQL runs OK on the query browser. However, PHP is always unable to be connected during the call. could you please?
------ Solution --------------------
The defined name is p_cong_ss.
The access name is p_ss.
Besides, you also need to pass a parameter.
------ Solution --------------------
I don't know what the problem is.
------ Solution --------------------
Output error content to see if any prompt is displayed.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service