In this tutorial i will teach you how to delete information stored in your database. This tutorial is a continuation of the PHP Gallery tutorial.
|
|
Introduction:
First we need to download couple software to get this working. We will be testing it locally on the computer first, then once its working we will upload it to the web server. This tutorial continues after the PGP Gallery, so i am assuming that you have the database setup and working with dreamweaver. You can follow this tutorial first if you have not. Its very simple, i will walk you guys through each step. So lets get started.
- WAMP5 : http://www.wampserver.com/en/index.php
Step1: Create and Setup database
Create a new PHP page verify.php Click ok, and click Bindings

Click on and select Recordset. Create the recordset below.

Table Code, copy and paste it into dreamweaver.
<table width="400" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="90" bgcolor="#F4F4F4">Title:</td>
<td width="296" bgcolor="#E6E6E6"></td>
</tr>
<tr>
<td bgcolor="#F4F4F4">Image:</td>
<td bgcolor="#E6E6E6"></td>
</tr>
<tr>
<td bgcolor="#F4F4F4">Thumbnail:</td>
<td bgcolor="#E6E6E6"></td>
</tr>
<tr>
<td bgcolor="#F4F4F4">Description:</td>
<td bgcolor="#E6E6E6"></td>
</tr>
<tr>
<td bgcolor="#F4F4F4">ImageURL:</td>
<td bgcolor="#E6E6E6"></td>
</tr>
<tr>
<td colspan="2" align="center" valign="middle" bgcolor="#F4F4F4"> </td>
</tr>
</table> |
Doing that will give you the table below

Click on the (+) next Recordset, you will see the fields shown above.

Click and Drag the title field over to the table as shown below.

Double click on the Recordset (rs67k) name.

This will open the window below. here we will be able to filter the information that will be displayed on the delete page.

click ok when you are finish.
Go back to the main page, in our case its the gallery.php page. Here we will add a delete button linking to the verify.php page.

After adding the delete text, double click on it to add a link

With the delete button highlighted click on the folder you see above opposite the link bar. This will open the window below, here is where we will specify the filters.

Click on the verify.php, now click parameters

Type in the name id, for the value click on the lighting bolt.

Select id and click ok. Text the gallery.php page with the delete button. At this point the filter should work. Next we will delete the information.
Click over to the verify.php page, and add the delete text shown below.

Create a new page and name it delete.php highlight the delete button and link to it as you previously did. With the linking completed. click on the delete page, here is where we will add the code.

Click Insert > Data Objects > Delete Record

Fill in the information and click ok when you are finish. Save all the pages and upload it to your local site, if you followed along it will work. If you are having problems contact us or check out the video.
Finish:
Finished, Need help or have questions feel free to contact us.
This Tutorial was Created By Trick Digest
© 2011 trickdigest.com. All Rights Reserved. |