Insert, Update, Delete in PHP using Dreamweaver CS5

Adding data to database using input in Forms

We often need to insert data into database. We use forms to post the Data. This process is often lengthy and tiresome. You can easily insert data to Database Using Dreamweaver with almost no hand coding. If you are already familiar with DreamweaverCS5, just need to follow the steps below:

  • Insert a form
  • You can use tables to show the labels and Text fields and Lists for input
  • If you want to use a list Dynamic (that will show data in list items fetching somewhere from database), you need to do 2 things:


1. If menu items are from other table, create a Record set using SQL queries that will select the List Items.
2. Select the expected menu list in the form, go to: Properties > Dynamic
§ Dynamic List: Options from recordset (select your Recordset)
§ Select the Values (it is ID in most cases, you chose yours)
§ Label (selects the label of the Menu List)
§ As the value need to match any column of your existing Main recordset ( the main table where you want to insert data), select the SELECT EQUAL VALUE TO for the option.

  • Server Behavior > Insert Records > Select Tables (chose in which table you want to insert data)

o Try to select the primary key of that Table in the ID section that is to select
o You can select where to go back after inserting data.
Tips: If you create the names of fields of Form according to the names of DB columns, DW (Dreamweaver) finds and matches those fields automatically during Insert Options, including their datatypes

Making List of Expected Data Using Dreamweaver

Suppose I want to show a list that includes the information about the students of the class. You need to have a database.

  • Connect to database
  • Creating a record set using BINDINGS PANEL (I need to use the perfect SQL here. There are ‘Simple’ and ‘Advanced’ options)
  • Go To : Insert > Data Objects > Dynamic Data > Dynamic Table

o Thus a list is generated. You can select how many rows you want to show in the list.
o You can set First, Previous , Next, Last links about the list
o Write FIRST anywhere, select this text, go to: Server Behavior > Recordset Paging > First/Previous/Next/Last
o If you don’t want to show ‘First’ link in first page, go to: Server Behavior > Show Region

Updating data using input in Forms

  • Binding > Recordset (new) which table of data I am going to update

o Default SQL filtered by Primary Key
o Filter = URL parameter = ID **

  • Create the Form with text fields and lists…

o Click on the field > Properties > init value
o For list à dynamic > ID label fix > init value

  • In action, need to pass ‘’hidden data entry form’’

o Put cursor inside FORM.
o Insert > form > hidden field
o Click on design panel’s Hidden value à Id (which is PK ) as init value

  • Find the hidden value, if not there, go to FIND ALL à ID = PK

o If this is ‘’-1’’ then make it 1

  • Go to Server Behavior à Update Record <value> FORM.pk as id
  • When you make link to EDIT page:

o List page where id of specific entry is available
o Make anyplace linked for ‘’update now’’ à properties > link >update.php
o Go to Code view à <a href = “update.php?id=**here is binding panel >recordset > id**>

Deleting data list in DW

  • Blank page, clear everything:
  • Server behavior > Delete records > primary key value > id
  • Fist where to go after deletion
  • Now run the page.

o If nothing is there, go to CODE
o Find “delete go to{ …..} “ this portion out of the logical if segment and before the last brace.

  • Link this file where to DELETE. In this linking, the link alphabetical case is factor, so need to be careful.

8 thoughts on “Insert, Update, Delete in PHP using Dreamweaver CS5

  1. ok after select insert and update the display of data is static. i want every record to be clickable s that if you click it, a specific details of every row will appear

  2. Winbars..!! all u need to do is to add a record-set itself and bind each fields together, or u can drag and drop the field record-set for each other one after the other. all u will achieve is being able to call the information’s in the database to the form, so u can see actually what is in that form, eg News so u can read through and edit and after what! submit back as update, while overriding the old file so easy.. remember the appearance or arrangement is base on ur sorting of record-set, or u can try the hard one that allow u to select each info and specifically update them.. check out for Building Your First Dynamic Website at Adobe..
    Hope it was of help to u, am not a programmer but a novice so please don’t be disappointed if i can’t answer u well Thanks

  3. Hello there,
    I have a need of creating fields for a table in the MySql via DW.

    For an example,
    If I have an empty table (no fields in it) in the MySql server but I want the users to create fields using the DW. Is this possible.

    I could not find any help on this subject.

    Many thanks in advance.
    Ranjan

  4. assalam alikum is there a way to fix the redirection of page to a popup after submitting the details in database using Dreamweaver insert form php program

  5. Hɑve you еver thought about adding a little bit more than juist your
    articles? I mean, what you sɑy is fundamental and all.
    But imagine if you added soje great photos or videos to gige yoour ƿosts more, “pop”!
    Your content is excellent bսt with images and video clips, this blog coսld definitely be oone of thе greatest in its field.

    Very good blοg!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s