PHP Classes
elePHPant
Icontem

SQL Proc Func: Run stored procedures and queries read from files

Recommend this page to a friend!
  Info   Demos   Screenshots Screenshots   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-10-17 (2 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 374 This week: 1All time: 6,410 This week: 1,047Up
Version License PHP version Categories
sql-proc-func 0.0.1MIT/X Consortium ...5.3HTML, PHP 5, Databases
Description Author

This class can run stored procedures and queries read from files.

It can read SQL statements for executing stored procedures from files.

The queries are executed as prepared statements taking given arguments.

The class may also read all SQL statement files and display them in an HTML table.

Picture of Andras Toth
  Performance   Level  
Name: Andras Toth <contact>
Classes: 3 packages by
Country: Hungary Hungary

Details
SqlFuncProc
===========

Useful tool for a fast development, when working more developers in one project.<br>

Demo: <a href="http://atandrastoth.co.uk/main/pages/phpclasses/SqlFuncProc/">Live Demo</a><br>
<img src="demo.PNG"><br>

usage:<br>
-create sql script with your favorite application<br>
-replace the parameters of the ?<br>
-save sql script to predefined folder<br>

<pre>
	require_once('SqlFuncProc.php');
	// get instance with PDO connection data
	//$func = SqlFuncProc::getInstance("mysql:host=YOURSERVER;dbname=AdventureWorks2012;charset=utf8", yourname, yourpass);
	$func = SqlFuncProc::getInstance("sqlsrv:Server=YOURSERVER;Database=AdventureWorks2012", null, null);
	// Functions list from folder with parameters : viewFunc($name = "", $class="")
	// $name: chars from filename, $class: table class
	echo $func->viewFunc("", "table table-bordered");
	// Processes list from folder with parameters : viewFunc($name = "", $class="")
	// $name: chars from filename, $class: table class
	echo $func->viewProc("", "table table-bordered");
	//Run noerror proc runProc($proc, $params = array(), $force = false);
	//$proc: process name, $params: parameter array
	$data = $func->runProc('noerror', array(50));
	print_r($data);
	//Run OrganizationTree func: runFunc($proc, $params = array(), $limit = false) 
	//$proc: process name, $params: parameter array, $limit : returned rows count
	//return  array()
  	$data = $func->runFunc("OrganizationTree",array(1,0), 10);
  	//Create HTML table from array: getHTMLtable($array = array(), $id = "", $class = "", $head = true) 
  	echo $func->getHTMLtable($data, "", "table table-striped", true);
</pre>

Add more feature in the nearest future...
 
Author: Tóth András

  demoExternal page  
Screenshots  
  • demo3
  • demo2
  • demo1
  Files folder image Files  
File Role Description
Files folder imageSqlFunc (1 file)
Files folder imageSqlProc (2 files)
Accessible without login Image file demo.PNG Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file README.md Data Auxiliary data
Plain text file SqlFuncProc.php Class Class source

  Files folder image Files  /  SqlFunc  
File Role Description
  Accessible without login Plain text file OrganizationTree.sql Data Auxiliary data

  Files folder image Files  /  SqlProc  
File Role Description
  Accessible without login Plain text file error.sql Data Auxiliary data
  Accessible without login Plain text file noerror.sql Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 70%
Total:374
This week:1
All time:6,410
This week:1,047Up