Home arrow MySQL arrow Page 2 - How To Create A PHP Front-End To Your MySQL Database Using DaDaBIK
MYSQL

How To Create A PHP Front-End To Your MySQL Database Using DaDaBIK


Sure, all PHP developers have used PHPMyAdmin, but have you heard of DaDaBIK? In this article Eugenio talks about DaDaBIK and shows us how to use it to create a front-end for a MySQL database with it in under 5 minutes.

Author Info:
By: Eugenio Tacchini
Rating: 5 stars5 stars5 stars5 stars5 stars / 57
September 06, 2002
TABLE OF CONTENTS:
  1. · How To Create A PHP Front-End To Your MySQL Database Using DaDaBIK
  2. · Database Table Creation
  3. · Database Table Creation (contd.)
  4. · Customizing DaDaBIK
  5. · Conclusion

print this article
SEARCH DEVARTICLES

How To Create A PHP Front-End To Your MySQL Database Using DaDaBIK - Database Table Creation
(Page 2 of 5 )

I want to start immediately with a simple example: imagine that we need to manage a database that contains the information of a group of people (e.g. the customers of a company) via a web page; the database (contacts_db) contains just one table (customers_tab), which includes the following fields:

ID_cust An auto: incrementing numeric field. Primary key of the table
first_name_cust: the first name of the customer
last_name_cust: the last name
country_cust: the country
phone_cust: the phone number
email_cust: the e-mail address
web_cust: the address of the web site
age_cust: the age
job_cust: the job type
notes_cust: additional notes about the customer
update_date_cust: the date on which the information about this customer was last modified

Here's the SQL statement you can use to create the table:

CREATE TABLE `customers_tab` (
`ID_cust` SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`first_name_cust` CHAR(50) NOT NULL,
`last_name_cust` CHAR(50) NOT NULL,
`country_cust` CHAR(50) NOT NULL,
`phone_cust` CHAR(20) NOT NULL,
`email_cust` CHAR(50) NOT NULL,
`web_cust` CHAR(100) NOT NULL,
`age_cust` CHAR(3) NOT NULL,
`job_cust` CHAR(50) NOT NULL,
`notes_cust` TEXT NOT NULL,
`update_date_cust` DATE DEFAULT '2002-08-31' NOT NULL
);


And, if you're very lazy then here are the insert statements you can use in order to insert some sample records:

INSERT INTO customers_tab VALUES (1, 'John', 'Smith', 'USA', '+1 555-123456-487-89', 'john@smith.com', 'http://www.john.com/', '36', 'Teacher', 'This is our best customer.', '2002-08-31');

INSERT INTO customers_tab VALUES (2, 'Marco', 'Rossi', 'Italy', '+39 0523 23568956', 'marco@rossi.com', 'http://www.rossi.com/', '27', 'Programmer', '', '2002-08-31');

INSERT INTO customers_tab VALUES (3, 'Luigi', 'Verdi', 'Italy', '+39 02 568956235689', 'luigi@ver-di.it', 'http://www.luigi-verdi.it/', '35', 'Teacher', 'Returning customer.', '2002-08-31');

INSERT INTO customers_tab VALUES (4, 'Alberto', 'Bianchi', 'Italy', '+39 0523 895623569', 'alberto.bianchi@bia-nchi.com', 'http://www.abianchi.com/', '56', 'Entrepreneur', '', '2002-08-31');

INSERT INTO customers_tab VALUES (5, 'Patrick', 'Doe', 'UK', '+44 023 568956235689', 'pd45@pdoe.co.uk', 'http://www.pdoe.com/', '21', 'Student', '', '2002-08-31');

INSERT INTO customers_tab VALUES (6, 'Denis', 'Claire', 'France', '+33 06 8956 23568956', 'dc@cl-de.fr', 'http://www.cl-de.fr', '31', 'Musician', '', '2002-08-31');


Installation + Use Of DaDaBIK
Create a new directory under the root of your web server called my_dadabik.

Download DaDaBIK from http://www.dadabik.org/ and unzip the zip file; it includes some documentation files together with a folder called program_files; just copy the contents of that folder into your my_dadabikdirectory that you have just created.

Now, open the file config.php file in the include folder with a plain text editor (e.g. Notepad on a Windows system or vi on Unix) and specify your database access parameters; for example, if MySQL runs on your local machine and you can access your database contacts_db with the user root and password mypass, your configuration file will start something like this:

$host = "localhost";
$user = "root";
$pass = "mypass";
$db_name = "contacts_db";


You are now ready to install DaDaBIK. Run the install.php script from your browser (http://localhost/my_dadabik/install.php) and click on the install button. If the installation procedure has completed successfully then you should see some confirmation messages.

That's all there is to it! You are ready to manage your tables via the web -- just point your browser to: http://localhost/my_dadabik/index.php if you installed DaDaBIK on your local PC.
blog comments powered by Disqus
MYSQL ARTICLES

- MySQL and BLOBs
- Two Lessons in ASP and MySQL
- Lord Of The Strings Part 2
- Lord Of The Strings Part 1
- Importing Data into MySQL with Navicat
- Building a Sustainable Web Site
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- PhpED 3.2 More Features Than You Can Poke ...
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- Security and Sessions in PHP
- Setup Your Personal Reminder System Using PHP
- Create a IP-Country Database Using PERL and ...
- Developing a Dynamic Document Search in PHP ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials