Adding and deleting Records

Database menu | Webdevonline Extra


Manipulating a MYSQL Database on line

You need to get an interface to connect to your database so that you can service it on line.

In this way you can update records, add new ones and delete old ones. You can also change the way that the records are ordered etc

(1) Third party CGI tools to connect to a mySQL Database

Many tools are available free, to carry out this work. Some will also connect to other types of dynamic relational databases as well as MYSQL. Many of these are complex and not for the faint hearted.

Look at some of the selection available below:

Program/tool set
Description
Availability/Download
Cost and comment
phpMyAdmin phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the WWW. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields, manage privileges,export data into various formats. May be set up for you by your hosting company. As part of your hosting package they may set up MYSQL database and the connection to a maintenance package

A very complete manipulation source. Make tables, add, delete records etc

Free for non commercial use. Requires some expertise to install

Zip

mySiteMaker A collection of CGI tools to rapidly create web interfaces to MySQL database tables. Features include: Web based configuration, Automatically generates Search, Results and Edit HTML screens, The search screen is very simple, easy to use and does not require the user to have any knowledge of SQL, www.itlab.musc.edu/mySiteMaker/

Free for non commercial use

Requires other modules to be installed.
(DBI Module, DBDmysql
CGI.pm) See CPAN

Requires some expertise

DB_Browser A CGI tool for developers working with a relational database. It easily facilitates searching, editing, www.summersault.com/software
/db_browser/
Requires some expertise
Requires other modules to be installed.
(DBI Module, DBDmysql
CGI.pm) See CPAN
mysqlwdb A free (GPL) cgi script written in Perl5. Easy to configure and install, it is intended to manage MySQL database tables through a web interface. Just edit and configure one file. www.solution4web.com/mysqlwdb

 

Free for non commercial use

Simple to install from one script

Matts MySQL Panel

i** Recommended choice **

A collection of PHP scripts written to allow management and administration of a MySQL database on a remote web server. The scripts allow for basic administration of the database with table querying, record modify and deleting and other functions such as field and key management..

Mattsscripts.co.uk

 

A superb collection of PHP scripts. Allows you to query your mySQL database
Perlmyadmin web-based mysql administration tool written in perl. All common mysql tasks are supported such as dropping and creating tables, managing columns and keys and other helpful features like exports and imports and full search capabilites

Download from Hotscripts

www.hotscripts.com>

>Free for non commercial use


PerlMyAdmin is distributed under the Artistic licence

How to use these programs/tools


You will need to make requested modifications (your Mysql host, user nsames and passwords etc) on the scripts to allow them to communicate with your Mysql database.
Then you will have to FTP them up to your web server. to run them. All scripts will need to have access permissions altered after uploading. This means you need a FTP program that allows you to give the UNIX command chmod to change file permissions (see WsFTP)

(2) Servicing your database using Dreamweaver Routines

You can use Dreamweaver to build servicing pages - add new records and alter/delete old ones

You need to build interactive forms to connect to the database

  • Select to build a new PHP page
  • Turn on the Application tab in the Insert Bar
  • You will need to have gone through all the stages outlined in Interactive databases 2 in
  • order to connect to the database ( - make a testing server connection, establish a connection )
  • Remember to go on line whilst constructing the PHP page

 

Learnsouthwest
Attractions Database

Servicing Page

 

Create a Record Insertion Form 

  

  • Make a new PHP dynamic page with any banners instructions etc
  • Place the insertion point where you want the Record Insertion Form to be placed
  • Select the Record Insertion Form iconfrom Insert Bar/Application
  • You will need to create a new recordset - you select all the fields and set no filters.
  • You will then see the record structure defined in the recordset with an insert button as below.

 

Create a Record Update Form 

  

This is quite complex and not for the faint hearted! You have first to find the record to update and then display it before altering it and telling the server of your changes.


Both stages can be carried out on one page

  • Set up a Search Form (as in Interactivedatabases4)
  • Add a results form to the page as below using the Record Update form (or by setting up each field box individually and dragging the dynamic field connections from the recordset into each individually)

  • Now you have to assign an Update Record server behaviour to EACH field in turn to allow it to be updated on the server.
  • This update page should not be obviously displayed on your website!