Part1: What do I need to get started? (if you followed the previous php tutorial, display PHP MySQL data can can skip to step 5)
Since I am doing this locally on my machine For this to work you will need to have the software below installed. Also if you want to apply this to your live web site, your hosting company need to run PHP MYSQL
-
WAMP5 : http://www.wampserver.com/en/index.php
-
EMS SQL Manager for MySQL (WAMP5 comes with a sql manager, you can use it, or which ever one you are familiar with.
Download and install both software, if you installed wamp5, by default it would create a folder located in C:\wamp\www\, create two more folders inside the www\ directory called localroot and the other webroot.
Part2: Creating the database and tables.
Start up EMS and click on the create new database icon.
Create a new database with the name, pixeltest_db and click next, and you will see the window below.
Click next and Finish. When you do that you should see the Registration database window. Just click ok. We need to create the user to access the database click on the User Manager Icon . Change the Servers to Localhost and click ok. At this point click on the Add User Icon when you do that you will see the window below.
This is just a demonstration, so your username and password will be different. Make sure to select All Privileges and With Grant option. With that click ok to apply the settings.
Double click on the database you just created.
When you do that you will connect to the database where you will be able to see the tables.
With that click on the Create new table icon shown below.
With that it should send you into the Table Properties window. Click on the Fields tab.
Double click on the Column and enter the information shown below, below is how your table should look..

Table 1
With that click on Compile after your tables has finished compiling click on Data
Click on to Insert Record. Fill in the information shown below. The id is an auto increment so you don't need to do anything with that. After each data entry make sure to click on Post Edit
This is how your table should look, with the data entered. The image location will be different depending on where you place the images.

Well we are finished with the database part.
Part3: Setting up Dreamweaver and creating the form.
Start up Dreamweaver and click New Site Manage Sites..
and click New Site. Click on the Advanced Tab and you will see the window below. Click on Local Info and fill in the information shown.
Local Info
Remote Info
Testing Server
When you are finished click ok, Done
Part4: Connecting to the database.
Click File New... and click on Dynamic Page PHP and click Create.
Click on the Shown in the databases tab and click on MySQL Connection.
With that the window below will come up. Fill in the information shown below.
This information has to match up with what you created using EMS, The password I used is pixeldigest.
Next click on Select, select the pixeltest_db database and click ok twice.
Part5: Creating the edit page.
Create a new page, hit Ctrl+S and save your site as edit.php. You will need to read the previous tutorial on how to "Display PHP MySQL Data" because after editing your information you have to view it, and I explain how to do this in the previous tutorial.
After doing that, In your application window click on Bindings and create a new Recordset

Click, ok to apply setting. Now click on Insert Application Objects Update Record Record Update form wizard. With that you will see the window below.

Click ok, and you should see the form below.

Open, the index page and edit the table as shown below.

Double click on Edit, in the properities window click on the yellow folder next to the Link box.

Next click parameter, type in id in the Name box and click on the lightning bolt in the value box, with that the window below will come up.

Click to select, field1_id. Click ok twice, and will should be at the select file window. Select the edit.php file and click ok. This is the link that I have on the edit text
edit.php?id=<?php echo $row_rs1['field1_id']; ?>
Just hit F+12 to preview your page, click on edit and edit your information it should work with out a problem.
Finished:
Well that is it, hope it came out to what you expected. If you have any question or comment about this tutorial, feel free to post a message on the forum.
This Tutorial was Created By Mark
© 2007 pixeldigest.com. All Rights Reserved. |