PHP Classes

MySQL SP: Emulation of MySQL stored procedures

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 53%Total: 2,477 All time: 1,563 This week: 488Up
Version License Categories
mysql_sp 1.0BSD LicenseDatabases, Templates


This class is meant to provide an emulation of stored procedures for MySQL.

It uses template files stored on the database client side that contain multiple SQL statements with special marks that identify placeholders that are replaced by procedure arguments when they are executed.

The result of the execution of procedure is an array containing either the handles of the result set of the SELECT statements or the number of affected rows of other statements.

Innovation Award
PHP Programming Innovation award nominee
April 2004
Number 5

Prize: One downloadable copy of Komodo
Despite the MySQL popularity among PHP developers, it always had several limitations when compared to high end commercial databases. One of such limitations is the lack of support for stored procedures that could be used to encapsulate several SQL statements in a single function that just takes a few arguments to execute.

This class provides a MySQL client side solution that implements a stored procedure language using files to store the procedure SQL statments.

Despite the support for MySQL server side based stored procedurex is planned for one of the upcoming releases of MySQL, the solution provided by this class provides right now part of the benefits of using stored procedures in MySQL based PHP applications.

Manuel Lemos
Picture of Alexandar Minkovsky
Name: Alexandar Minkovsky <contact>
Classes: 3 packages by
Country: Bulgaria Bulgaria
Age: 53
All time rank: 1661 in Bulgaria Bulgaria
Week rank: 305 Down1 in Bulgaria Bulgaria Equal
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Accessible without login Plain text file createAccount.sql Data sample stored procedure
Accessible without login Plain text file example.php Example Example class usage
Accessible without login Plain text file junk_db_create.sql Data Creates the example database (executed by example.php)
Plain text file mysql_sp.class.php Class The class file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:1,563
This week:488Up
 User Ratings  
 All time