PHP Classes

Simple PHP Database Manager: Build and run SQL queries with a fluent interface

Recommend this page to a friend!
  Info   View files Example   View files View files (68)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-06-15 (Yesterday) RSS 2.0 feedStarStarStar 51%Total: 399 This week: 2All time: 6,573 This week: 35Up
Version License PHP version Categories
db-manager 1.17GNU General Publi...5.3PHP 5, Databases
Description 

Author

This class can build and run MySQL queries with a fluent interface.

It can compose SQL SELECT, INSERT, UPDATE and DELETE queries with a fluent interface of functions to define several parameters of the queries.

The functions can define the table fields, field values, query conditions, etc..

Picture of Vagner vinicius bispo cantuares
  Performance   Level  

 

Example

<?php
require_once 'db_manager.php';

$db = DB_Manager::get_instance();
$db->database();

$db->table = 'users';

# all results.
$result = $db->select('*')->getAll();
echo
'<pre>';
   
var_export($result);
echo
'</pre>';

# one result.
$result = $db->select('*')->where('username', 'cantuares')->get();
echo
'<pre>';
   
var_export($result);
echo
'</pre>';

# insert record.
$result = $db->values(array('username' => 'fulano', 'password' => '***'))->insert();
echo
'<pre>';
   
var_export($result);
echo
'</pre>';

# update record.
$result = $db->set(array('username' => 'sicrano'))->where('username', 'fulano')->update();
echo
'<pre>';
   
var_export($result);
echo
'</pre>';

# delete record.
$result = $db->where('username', 'sicrano')->delete();
echo
'<pre>';
   
var_export($result);
echo
'</pre>';

?>


Details

PHP Database Manager

Small and simple class for MySQL database management.


  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Files folder imagedocs (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Plain text file db_manager.php Class Class source
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file example_sql.sql Data Auxiliary data
Accessible without login Plain text file LICENSE Data Auxiliary data
Accessible without login Plain text file README.md Doc. Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:399
This week:2
All time:6,573
This week:35Up
 User Ratings  
 
 All time
Utility:62%StarStarStarStar
Consistency:68%StarStarStarStar
Documentation:68%StarStarStarStar
Examples:68%StarStarStarStar
Tests:-
Videos:-
Overall:51%StarStarStar
Rank:2474