Mysql Table Editor

In a php project, if we get the requirement , we usually start design and database. But the data entry procedure is very hard. In this case PhpMyadmin is a good comfort. 

Here is another tool from phpguru.org , MySQL Table Editor. Using this library you can make your database table editable from your php code. 

You can  :

  1. Select the table to be displayed
  2. decide which column should be hidden
  3. Whether a column should be editable or not
  4. Add advanced searching option
  5. Download the table as csv format
  6. Add pagination
  7. Set alias display name for your column
Download Library from: 
Documentation:
Sample Code Below:
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once('TableEditor.php');
//database connection object
$db_conn = mysql_connect('localhost','root','');
mysql_select_db('mydbname');
//select the table to be edited, here it is accounts
$editor = new TableEditor($db_conn, 'accounts');
//I dont want to display id and password column
$editor->noDisplay('id');
$editor->noDisplay('password');
//the email column should not be editable
$editor->noEdit('email');
//set display name for column email and login
$editor->setDisplayNames(array('email' => 'Email',
'login' => 'Username'
));
//sort order of first name
$editor->setDefaultOrderby('namefirst', 0);
//set which are the filed to be searchable
$editor->setConfig('searchableFields', array('namefirst', 'namelast', 'email'));
//can set the type of input field
$editor->setInputType('available', 'select');
//finally display the editor window
$editor->display();
?>
3 Comments , , , , , , ,

3 Responses to “Mysql Table Editor”

  1. Ronnie Sullivan July 3, 2009 at 12:51 pm #

    Great Job ..Exactly ..Perfect points mentioned

  2. Cartoon Bears July 28, 2009 at 11:25 pm #

    I’ve been using the MySQL Administrator and MySQL Query Browser.

    The problem is those program only allow me to create and edit tables and columns but not the actual data itself.

    So are there any Visual MySQL database editor that actually let you enter data, copy and paste, drag data around where ever I want, all just with the mouse ?

    Oh, also I don’t want to learn the codes to do those kind of things. I find learning and typing hundreds lines of code just to manage a 20 row 5 column data a bit too much of a work. =/

  3. Joseph Wright May 19, 2010 at 2:23 pm #

    i applied for data entry jobs over the internet and it is also a good part time job.,~:

Leave a Reply

More in php, php source code (48 of 111 articles)


Basically using xajax "You can directly call php functions from your javascript code" Xajax will do the rest.  For ...