PHP
  Home arrow PHP arrow Page 8 - 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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
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 / 31
    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 - In And Out


    (Page 8 of 10 )

    OK, so that took care of displaying the records - now how about inserting and deleting records?

    First, use the Dreamweaver editor to create an HTML form that maps to the columns of the "user" table.



    Once the form has been prepared, apply the "Insert Record" server behavior, and you'll see a dialog box like this:



    This dialog box makes it very easy to map form fields to the table in which data is to be inserted. Once you select the appropriate database connection and table, the fields of the table are displayed; these fields can be mapped to specific fields in the form via the "Value" drop-down list. Dreamweaver takes care of writing the SQL query needed to insert the data entered by the user in each field into the appropriate column in the table.

    After you've finished mapping form fields to table columns, remember to specify the URL to which the browser should be redirected once the data has been successfully inserted into the database.

    Once you're done, save the PHP script and access it via your browser. You should see the HTML form you created:



    Enter some values and submit the form. The code generated by Dreamweaver MX will insert the values into the "user" table and then redirect the browser to the URL selected...all without the developer writing a single line of code!

    It's just as simple to delete records - create a new PHP script and use the "Delete Record" server behavior. You'll see the following dialog box, which asks you to specify the variables that the script should use when identifying which record to delete.



    As you can see, in the example above, I've told Dreamweaver to look for the "id" variable in the URL string, and to delete the record corresponding to that ID in the "user" table. Save the script (I'll assume it's called "delete.php"), and access it via your browser (remember to add the "id" variable-value pair to the URL string, like thus: http://your.server/delete.php?id=15), and the record corresponding to the ID provided should get deleted from the database.

    Obviously, it's pretty easy to now link the three scripts above with each other, so as to build a primitive, yet fully-functional, user administration module (in case you're wondering, yes, Dreamweaver also comes with an "Update Record" behavior - I'll leave that to you to experiment with.)

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


     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway