PHP Classes

PHP DB Operations: Perform common database operations using MySQLi

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 251 All time: 7,911 This week: 455Up
Version License PHP version Categories
db-operations 1.0GNU General Publi...5Databases
Collaborate with this project 

Author

db_operation_class - github.com

Description

This class can perform common database operations using MySQLi.

It can connect to a MySQL database using MySQLi extension and performs common database table records operations.

Currently it can retrieve all records of a given table, insert new table records, update and delete records of a table that match a criteria.

Picture of Yasir Buriro
  Performance   Level  
Name: Yasir Buriro <contact>
Classes: 2 packages by
Country: Pakistan Pakistan
Age: 30
All time rank: 349045 in Pakistan Pakistan
Week rank: 276 Up6 in Pakistan Pakistan Up

Example

<?php
include_once("db_operations.php");
$dboperations =new db_operations("localhost","root","","user_management");
//array
 
$arr=array(
   
"user_id"=>9,
   
"user_name"=>"ali",
   
"user_lname"=>"buriro",
   
"user_email"=>"ali@gmail.com",
   
"user_pass"=>"ali",
   
"user_fname"=>"akbar",
   
"role"=>2
);

//inserting record into users table
echo $dboperations->insertData("users",$arr);

//update record from users having user_id=9
echo $dboperations->updateData("users",$arr,9);
// //Returning Multidimensional array
echo "<pre>";(print_r($dboperations->selectData("users")));

//fetching data with user_id 2
 
foreach($dboperations->selectData("users") as $k => $v){
    if(
$k==2){
        foreach(
$v as $key => $value){
            echo
$key."=>".$value."<br>";
        }
    break;
    }
}

//deleting record from table users having user_id=9
echo $dboperations->delete("users",9);
?>


Details

db_operation_class

Simple database class for operation with database securely


  Files folder image Files  
File Role Description
Plain text file db_operations.php Class Class source
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Data Read me

 Version Control Unique User Downloads Download Rankings  
 100%
Total:251
This week:0
All time:7,911
This week:455Up