PHP Classes

PHP MySQLi Queries: Simple MySQLi wrapper to execute common queries

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 40%Total: 452 All time: 6,167 This week: 39Up
Version License PHP version Categories
php-mysqli-queries 1.0.0Freely Distributable5PHP 5, Databases
Description 

Author

This class is a very simple MySQLi wrapper to execute common queries.

It extends the MySQLi class to add functions to execute SQL SELECT, INSERT, UPDATE, and DELETE queries.

Applications can use other MySQLi class functions to access the query result sets.

Picture of Fortune James
  Performance   Level  
Name: Fortune James <contact>
Classes: 4 packages by
Country: Nigeria Nigeria

Example

<?php
   
   
/*
    This is an example script to execute queries
    */
   
    // Establish Connection and requirements
   
require 'dbclass.php';
   
   
$conn= new myDB();
   
   
//Select Example
   
$sql="SELECT * FROM `mytable`";
   
$run=$conn->getData($sql);
   
$row=$run->fetch_object();
   
$fullname=$row->fullname;
   
    echo
$fullname;
   
   
//Insert Example
   
$sql="INSERT INTO `mytable` (id, fullname) VALUES(1, 'xxx')";
   
$run=$conn->setData($sql);
   
   
//Update Example
   
$sql="UPDATE `mytable` SET fullname='xxx' WHERE id=1";
   
$run=$conn->upData($sql);
   
   
//Delete Example
   
$sql="DELETE FROM `mytable` WHERE id=1";
   
$run=$conn->remData($sql);
   
?>

   
   
   
   
   
   


  Files folder image Files (2)  
File Role Description
Plain text file dbclass.php Class PHP Class File
Plain text file example.php Example PHP Queries Examples

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:452
This week:0
All time:6,167
This week:39Up
 User Ratings  
 
 All time
Utility:58%StarStarStar
Consistency:58%StarStarStar
Documentation:-
Examples:58%StarStarStar
Tests:-
Videos:-
Overall:40%StarStarStar
Rank:3788