DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   PHP MySQL 5.0 stored procedure (http://www.daniweb.com/forums/thread41143.html)

rcasinillo_s Mar 15th, 2006 5:46 am
PHP MySQL 5.0 stored procedure
 
Any could give me a PHP script on how to call or execute mysql stored procedure.

Thank you.

Roland

ameer Mar 21st, 2006 4:36 am
Re: PHP MySQL 5.0 stored procedure
 
Before you installed the php_mysqli.dll


<?php

/* Connect to a MySQL server */
$link = mysqli_connect(
'localhost', /* The host to connect to */
'root', /* The user to connect as */
'root', /* The password to use */
'db_name'); /* The default database to query */

if (!$link) {
printf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error());
exit;
}


/* Send a query to the server */
if ($result = mysqli_query($link, "call se_proc('crm')")) {


/* Fetch the results of the query */
while( $row = mysqli_fetch_array($result) ){

echo ($row[0]. "--------- SR. " . $row[1] . "<br>");

}

/* Destroy the result set and free the memory used for it */
mysqli_free_result($result);
}

/* Close the connection */
mysqli_close($link);
?>

kladizkov May 4th, 2008 4:59 pm
Re: PHP MySQL 5.0 stored procedure
 
Oh it was simple, just execute "call proc_name"

http://fabinm.com/content/view/17/9/

thinktejas Sep 10th, 2008 4:38 am
Re: PHP MySQL 5.0 stored procedure
 
There is an article on this site which shows how to access Mysql Stored procedures using PDO and PHP
http://tejuspratap.co.cc/2008/08/29/...-using-php-50/

mazeroth Jan 27th, 2009 11:31 pm
Re: PHP MySQL 5.0 stored procedure
 
Here's a quick tutorial on executing mysql stored procedures in php using mysql, mysqli, and pdo for the people using the different database extension:

http://www.joeyrivera.com/2009/using...ysqlmysqlipdo/

thinktejas Jul 13th, 2009 6:16 am
Re: PHP MySQL 5.0 stored procedure
 
Quote:

Originally Posted by thinktejas (Post 688045)
There is an article on this site which shows how to access Mysql Stored procedures using PDO and PHP
http://tejuspratap.co.cc/2008/08/29/...-using-php-50/

The article has been moved to http://www.tejuspratap.com/main/node/18

thinktejas Jul 16th, 2009 4:23 am
Re: PHP MySQL 5.0 stored procedure
 
Quote:

Originally Posted by thinktejas (Post 916148)
The article has been moved to http://www.tejuspratap.com/main/node/18

I am sorry I gave the wrong url before.

The article has been moved to http://www.tejuspratap.com/main/cont...s-using-php-50

kbramprasath Nov 16th, 2009 5:53 am
DROP PROCEDURE IF EXISTS `UsersR_DELETE_byPK` 
GO

CREATE PROCEDURE UsersR_DELETE_byPK
  (
        IN  UsersID            INT(11)
)       
BEGIN

  DELETE FROM UsersR 
                   
          WHERE  UsersID=UsersID;
                           
       
  END
it is my stored proceder how to call php code perfom delete operation


All times are GMT -4. The time now is 1:25 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC