PHP
  Home arrow PHP arrow Page 6 - Building PHP Applications With Macrome...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Building PHP Applications With Macromedia Dreamweaver MX
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 32
    2002-12-18

    Table of Contents:
  • Building PHP Applications With Macromedia Dreamweaver MX
  • Hooking Up
  • Test Drive
  • Breaking Ground
  • Naming Names
  • Bringing In The Database
  • Appearances Are Everything
  • In And Out
  • I, Robot
  • Weaving The Web

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building PHP Applications With Macromedia Dreamweaver MX - Bringing In The Database


    (Page 6 of 10 )

    One of the coolest features of Dreamweaver MX is the ability to build a dynamic database-driven Web site without having to write a single line of PHP code on your own. Over the next few pages I'm going to demonstrate how, by having Dreamweaver do the hard work of writing PHP code that allows you to view, add and delete records from a MySQL table.

    Let's assume that I have a database table called "user", as shown below.
    mysql> SELECT * FROM user;
    +----+----------+------------------+
    | id | username 
    | password         |
    +----+----------+------------------+
    |  3 | merrill  | 2fda14e52bde1a87 
    |
    |  4 | pooja    | 0d53926314545f3c |
    |  5 | john     | 2ca0ede551581d29 |
    | 
    6 | joe      | 7b57f28428847751 |
    |  7 | tom      | 675bd1463e544441 |
    |  8 | 
    bill     | 656d52cb5d0c13cb |
    +----+----------+------------------+
    6 rows in set 
    (0.05 sec)
    Now, the built-in features of Dreamweaver MX allow you to automate the processes of listing the records in the table, adding new records, modifying existing records, and deleting records - all with minimum hand coding.

    The first thing to be handled is the database connection. Dreamweaver MX does the dirty work of opening, managing and closing the database connection - all you need to do is pop open the "Application" panel (on the right side of the workspace), click the "Database" tab, hit the button with a plus (+) symbol on it, and select "MySQL Connection" from the option list.



    You should see the following dialog:



    This box allows you to specify access information for the database server. For this example, create a connection called "dbConnect" and provide Dreamweaver with the username and password required to access the database server, together with the name of the database to be used.

    Once the connection has been created, Dreamweaver will automatically add a set of scripts to your site directory; these will be used for all subsequent database interaction. If the connection is created successfully, you should be able to view all the tables (as well as views and stored procedures for compliant databases) in the "Database" tab of the "Application" panel.



    With the database connection created, the next step is to write a script that will list all the records in the table. Use the "Bindings" tab of the "Application" panel to create a "Recordset" object (click the button with the plus symbol again to get to this option) and you'll get a simple wizard-like interface which allows you to retrieve a set of records from the database.



    Once you've filled in the requisite information - note that you can also sort and filter the results - hit the "Test" button to see if everything works as it should. If it does, save your settings and you'll now see a new item in the "Binding" tab of the "Application" panel, referencing your newly created Recordset.



    You can customize the SQL query created via the "Advanced..." button in this wizard.

    More PHP Articles
    More By Harish Kamath, (c) Melonfire


     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT