PHP Classes

RA PHP MySQL CRUD class: Manipulate data in MySQL database tables

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
Not enough user ratingsTotal: 256 All time: 7,853 This week: 51Up
Version License PHP version Categories
ra-server_classtable 1.0.1Freely Distributable7PHP 5, Databases
Description 

Author

This package can manipulate data in MySQL database tables.

It can connect to a given MySQL database server and performs several types of operations to manipulate records in a given database table. Currently it can:

- Check if the table exists
- Retrieve the record data in the whole table with support to limit the number of records that are retrieved and sort in ascending or descending order
- Get the count of rows and columns in the table
- Get one record with a given id value
- Get the values of a column of the table
- Get the names of the table column
- Insert a record into the table
- Delete one record from table
- Query the table with a given condition
- Update a record of the table

Picture of Rafal Antczak
  Performance   Level  
Name: Rafal Antczak <contact>
Classes: 2 packages by
Country: Poland Poland

Example

<?php
/*
 * Example - get records from table
 */


// Include Table class

   
require_once 'class.table.php';

   
/*
 * Init new Table object with database parameters specified in db_params.php
 * In this example the name of your table is 'table1'
 */
   
   
$some_table = new Table('table1');

   
   
$my_data = $some_table ->getTable();
   
   
    if (
$my_data !== FALSE) {
       
       
var_dump($my_data);
       
    }


?>


Details

Class Table, typical CRUD class which allows add, edit, read and delete records/fields/tables of any MySQL database 2019, ra-server.pl Licence: free to use and edit Run index.php first and follow the instruction Replace database connection parameters in db_params.php

  Files folder image Files (14)  
File Role Description
Plain text file class.table.php Class Class source
Accessible without login Plain text file db_params.php Aux. Auxiliary script
Accessible without login Plain text file example_add_record.php Example Example script
Accessible without login Plain text file example_delete_record.php Example Example script
Accessible without login Plain text file example_get_column.php Example Example script
Accessible without login Plain text file example_get_row.php Example Example script
Accessible without login Plain text file example_get_table.php Example Example script
Accessible without login Plain text file example_get_table_fields.php Example Example script
Accessible without login Plain text file example_get_table_info.php Example Example script
Accessible without login Plain text file example_get_table_with_limit.php Example Example script
Accessible without login Plain text file example_get_table_with_query.php Example Example script
Accessible without login Plain text file example_update_record.php Example Example script
Accessible without login Plain text file index.php Aux. Auxiliary script
Accessible without login Plain text file readme.txt Doc. Documentation

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  
 100%
Total:256
This week:0
All time:7,853
This week:51Up