I have an access database with 3 different tables that all have the same field names (productid, producttitle, colour, size) but just for different products ie: one for tops, one for trousers, and one for hats. I have used the <cfswitch> statement that allows queries for each individual page to be read. But I want to be able to delete, add, and update the information in each individual table over my webpage. Also, I am using one form for all three applications and this is working out fine when it comes to displaying the contents of each table. The application is reading the content from each table but now I need to be able to delete, add, update this information from my website.
Any clue on how i could do this???
Thank you!!!!
here is the code for the cfswitch statement:
<cfswitch expression="#url.category#">
<cfcase value="Tops">
<cfquery name="read_apparel" datasource="kgillitgirl">
SELECT productid, producttitle, productdescription, colour, size, price, quantity
FROM Tops
</cfquery>
<cfoutput query="read_apparel">
<tr>
<td>
<a href="index.cfm?page=edit&category=tops&productid=#productid#&producttitle=#producttitle#&productdescription=#productdescription#&colour=#colour#&size=#size#&price=#price#&quantity=#quantity#">edit</a>
<a href="index.cfm?page=delete&category=tops&producttitile=#producttitle#">delete</a>
</td>
<td>#productid#</td>
<td>#producttitle#</td>
<td>#productdescription#</td>
<td>#colour#</td>
<td>#size#</td>
<td>#price#</td>
<td>#quantity#</td>
</tr>
</cfoutput>
</cfcase>
</table>
<cfcase value="Trousers">
<cfquery name="read_trousers" datasource="kgillitgirl">
SELECT productid, producttitle, productdescription, colour, size, price, quantity
FROM trousers
</cfquery>
<cfoutput query="read_trousers">
<tr>
<td>
<a href="index.cfm?page=edit&category=trousers&productid=#productid#&producttitle=#producttitle#&productdescription=#productdescription#&colour=#colour#&size=#size#&price=#price#&quantity=#quantity#">edit</a>
<a href="index.cfm?page=delete&category=trousers&producttitle=#producttitle#">delete</a>
</td>
<td>#productid#</td>
<td>#producttitle#</td>
<td>#productdescription#</td>
<td>#colour#</td>
<td>#size#</td>
<td>#price#</td>
<td>#quantity#</td>
</tr>
</cfoutput>
</cfcase>
</table>
</table>
</cfswitch>
Any clue on how i could do this???
Thank you!!!!
here is the code for the cfswitch statement:
<cfswitch expression="#url.category#">
<cfcase value="Tops">
<cfquery name="read_apparel" datasource="kgillitgirl">
SELECT productid, producttitle, productdescription, colour, size, price, quantity
FROM Tops
</cfquery>
<cfoutput query="read_apparel">
<tr>
<td>
<a href="index.cfm?page=edit&category=tops&productid=#productid#&producttitle=#producttitle#&productdescription=#productdescription#&colour=#colour#&size=#size#&price=#price#&quantity=#quantity#">edit</a>
<a href="index.cfm?page=delete&category=tops&producttitile=#producttitle#">delete</a>
</td>
<td>#productid#</td>
<td>#producttitle#</td>
<td>#productdescription#</td>
<td>#colour#</td>
<td>#size#</td>
<td>#price#</td>
<td>#quantity#</td>
</tr>
</cfoutput>
</cfcase>
</table>
<cfcase value="Trousers">
<cfquery name="read_trousers" datasource="kgillitgirl">
SELECT productid, producttitle, productdescription, colour, size, price, quantity
FROM trousers
</cfquery>
<cfoutput query="read_trousers">
<tr>
<td>
<a href="index.cfm?page=edit&category=trousers&productid=#productid#&producttitle=#producttitle#&productdescription=#productdescription#&colour=#colour#&size=#size#&price=#price#&quantity=#quantity#">edit</a>
<a href="index.cfm?page=delete&category=trousers&producttitle=#producttitle#">delete</a>
</td>
<td>#productid#</td>
<td>#producttitle#</td>
<td>#productdescription#</td>
<td>#colour#</td>
<td>#size#</td>
<td>#price#</td>
<td>#quantity#</td>
</tr>
</cfoutput>
</cfcase>
</table>
</table>
</cfswitch>