PHP
  Home arrow PHP arrow Page 6 - Building PHP Applications With Macromedia Dreamweaver MX
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PHP

Building PHP Applications With Macromedia Dreamweaver MX
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek