PHP Classes

PHP Mass Database Update: Update all MySQL database table records

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 288 This week: 1All time: 7,515 This week: 560Up
Version License PHP version Categories
mdu 1.0GNU General Publi...5.0PHP 5, Databases, Systems administration
Description 

Author

This class can update all MySQL database table records.

It can retrieve the list of tables of a given MySQL database and generate a HTML form to let the user choose the tables and fields he wants to update.

The class takes the submitted form values and executes a SQL UPDATE query to change the table field specified by the user.

Innovation Award
PHP Programming Innovation award nominee
September 2014
Number 6


Prize: One copy of VS.PHP
Sometimes it is necessary to perform maintenance updates to information stored in an application database.

This class makes that process easier by providing a Web based user interface to define bulk updates to values stored in given MySQL database table records.

Manuel Lemos
Picture of amani
  Performance   Level  
Name: amani is available for providing paid consulting. Contact amani .
Classes: 3 packages by
Country: Iran Iran
Age: 39
All time rank: 334565 in Iran Iran
Week rank: 411 Up4 in Iran Iran Up
Innovation award
Innovation award
Nominee: 2x

Recommendations

MySQL table editor
Need to be able to create an interface to edit the table data

Good and simple MySQL wrapper
What MySQL wrapper should I go with?

Example

<?php

/**
 * <name>Mass Database Updater</name>
 * <author>Akbar Amani </author>
 * <email> amania1364@gmail.com </email>
 * <version>Mdu v1.0</version>
 * <url>webreference.ir</url>
 * <copyright> Copyright (C) 2014 GNU General Public License. All rights reserved. GNU/GPL</copyright>
 */
 
 
include_once('Mdu.php');

$dbc = new Mdu();

// If user want update data call update method with all variables
if (isset($_POST['update_value'])) {
   
$method = $_POST['method'];
   
$variable = $_POST['field_value'];
   
$new_value = $_POST['new_value'];
   
$db = $_POST['db'];
   
$field = $_POST['field'];
   
$table = $_POST['table'];
   
$data = $dbc->$method($variable, $new_value,$db, $table, $field);
// If user want get tables or fields
} else {
   
$method = $_POST['method'];
   
$variable = $_POST['parametr'];
   
$data = $dbc->$method($variable);
}

echo
$data;

?>


  Files folder image Files  
File Role Description
Plain text file jquery-2.0.3.min.js Data javascript library file
Plain text file javascript.js Data class javascript functions
Plain text file Mdu.php Class Class file
Plain text file config.ini Data database configuration
Plain text file loader.php Example load class method for ajax
Plain text file index.php Example Example of Mass Database updater

 Version Control Unique User Downloads Download Rankings  
 0%
Total:288
This week:1
All time:7,515
This week:560Up