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

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 / 58
September 06, 2002
  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

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

You should see a screen that looks something like this:

Running DaDaBIK for the first time

Here's an example of searching for a customer whose last name is Smith:

Searching for someone in our database

... and the corresponding result:

The result of our search

We can update this result by clicking on the edit icon (the first of the three icons before the record in the table):

Updating a record

Of course we can also insert and delete records just by following the menus. So, I hear you say, is that all that DaDaBIK can do? Well, no... what you've seen is only the beginning. The strength of DaDaBIK lies in the possibility to customize the interface we have just created and now we are going to see how to do it.

The first thing to notice is that we don't want the same fields in all of the DaDaBIK forms; for example in the insert form we don't need the ID_cust field because it is an auto incrementing field. We also don't want the update_date_cust field, because DaDaBIK has to fill this field in automatically when a record is updated. In the search form, instead, we want to give the possibility to perform a research by using the first name, last name or job type fields, so we want to include only the first_name_cust, last_name_cust and job_cust fields.

Another important feature of DaDaBIK is the ability to change the way that table fields are displayed - we can give them "friendlier" display names.

Almost all of the customisation options for DaDaBIK are available through the admin.php script, so point your browser to http://localhost/my_dadabik/admin.php:

Setting the configuration options for DaDaBIK

Click on the "Internal table manager". The internal table manger is a tool that allows us to modify the interfaces we use for our MySQL tables (in this case the interface of customers_tab); from the internal table manager you can choose the label of the fields that you want to display in the forms, which fields are required, the content type of the fields and so on. Click on the "Show all fields in a page" button to have all of the fields displayed in a page and start configuring your interface:

In this example I changed the label of ID_cust from ID_cust to ID customer, and I also decided not to include this field in the insert/update forms, as well as the search form:

Configuring labels for tables

I will also change the label of the field first_name_cust to First name, which looks better and is easier to understand:

Changing the label of the first_name_cust field

I change the field type property of update_date_cust, setting it to update_date. Update_date is a built-in DaDaBIK field type (we'll see more about these later in the article). By using this type, DaDaBIK doesn't show the field in the insert/update form, but will automatically fill it with the current date when the content of a record is modified.

Changing the variable type for a field

We then change labels and the "Field present" properties for all of the fields according to our needs and then we save the configuration.

As you can see, our search form now looks better:

Our search form with only the searchable fields displayed
blog comments powered by Disqus

- 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 

Developer Shed Affiliates


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