new features
version comparison
features: php tools
php debugger
php profiler
php frameworks
php scripts
features tour
php testing
PhpED difference
PhpED on Mac/Linux

PHP Database Scripts by NuSphere

PHP Database scripts presented here are generated by NuSphere DB-Form Wizard in NuSphere PhpED (PHP IDE).
This particular set of scripts provides the form that can be used to browse, insert, update and delete the data records in MySQL server table "items". Table "items" belongs to the database "shopcart" and has the following fields:
  • Itemno - [char] (4) NOT NULL,
  • Description - [varchar] (30),
  • offered_by - [char] (3),
  • start_date - [date],
  • end_date - [date],
  • reserve_price - [decimal]

How are PHP Database scripts generated

PhpED's Db-Form Wizard substitutes macros in the templates provided by the user and generates PHP code working with the database. While templates mechanism in DB-Form wizard is pretty generic, it is most commonly used to generate two sets of scripts:

  • front end script to display PHP/HTML Form to post the requests to the database
  • back end script to process DB requests

In this example NuSphere PHP Database scripts are using Ajax requests to submit DB queries. The following is the brief description of the PHP Scripts used in this example:

  • ajax_db_form.php - generates Ajax based HTML form to browse, insert, update and delete the data records in "items". Gemration of Ajax request is implemented in Javascript functions getAjaxRequest(),ajaxFunctionDelete() and ajaxFunctionForm()
  • table_items.php - handles Ajax requests to process DB queries on the back end.
  • - contains db connection settings
  • - implements PHP Class dbconn and several DB utilities
  •,,,,, - implement database specific queries. File db_ is used in this particular example to connect with MySQL database server.

See PHP Database Ajax for more details on the implementation of these scripts.

How to use PHP Database scripts

  • Download zip archive of NuSphere PHP Database scripts.
  • Extract the files to the destination directory
  • Make sure that MySQL extension is loaded
  • Create database "shopcart" - you can run db commands in NuSphere's PHP Database Connection Client. To create the database in MySQL run "create database shopcart".
  • Create the table and insert some items into it:
CREATE TABLE `items` (
  `Itemno` varchar(4) NOT NULL,
  `Description` varchar(30) NOT NULL default '',
  `offered_by` varchar(4) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `reserve_price` decimal NOT NULL

insert into items
  values(1001,'Red Bicycle','U01',
insert into items
insert into items
  values(1003,'Old Bicycle','U02',
insert into items
insert into items
  values(1005,'Tennis Racket','U03',
insert into items
insert into items
  values(1007,'Racing Bicycle','U04',
insert into items
  values(1008,'Broken Bicycle','U01',
  • Update with your database connection/authentication settings
  • Execute ajax_db_form.php. You can run it in PhpED PHP Viewer.

You can manually edit and modify ajax_db_form.php, table_items.php and to work with any other database and tables.

Learn more about generating PHP Database using NuSphere DB-Form Wizard and take a look at other PHP Tools and PHP Scripts provided by NuSphere PhpED - PHP IDE

Download zip archive of NuSphere PHP Database scripts here

 Download NuSphere PHP IDE

Download a free trial of the fast PHP EDitor and robust Integrated Development Environment for PHP.

 Buy NuSphere PhpED® now

Best PHP Editor and complete PHP IDE.
NuSphere PhpED 21.0 is available from our online store front.

 Special Team4 Offer

Get 4 copies of PhpED for the price of 3!

Optimum solution for development teams.
PhpED 21.0 Team4
Need more than 4 licenses? Contact Us for more quantity discounts, please use "Ordering/Payment issue" subject on the form.

 Dr. Dobb's

Dr. Dobb's

Dr. Dobb's Magazine covers NuSphere PhpED in New and Noteworthy section.

PhpED is a proper, world-class IDE for PHP code. It is the only IDE worth considering if PHP development is your primary job