Coldfusion (CFM) - Updating A Category to Database using Stored Procedure + session
<cfif IsDefined(’Session.PERSONID’)>
<cfif IsDefined(’FORM.Submit’)>
<cfquery name="qCateg" datasource="webfillers">
EXEC sp_update_category
@CATEGORY = ‘#FORM.category#’,
@DESCRIPTIONS = ‘#FORM.descriptions#’,
@PRODUCTCATEGID = #FORM.productcategID#
</cfquery>
<cfoutput>
<ul>
<li><strong>#FORM.Category#, has been successfully updated….</strong></li>
</ul>
</cfoutput>
</cfif>
<h2>Update Employee</h2>
<cfquery name="qCateg" datasource="webfillers">
EXEC sp_get_productcategID @PRODUCTCATEGID = #URL.productcategID#
</cfquery>
<form method="post">
<cfoutput>
<table width="308" border="1">
<input type="hidden" name="productcategID" value="#qCateg.PRODUCTCATEGID#"/>
<tr>
<td width="128"><div align="right">Category ID : </div></td>
<td width="164"><input type="text" name="productcategID" value = "#qCateg.PRODUCTCATEGID#" disabled/></td>
</tr>
<tr>
<td width="128"><div align="right">Category : </div></td>
<td width="164"><input type="text" name="category" value = "#qCateg.CATEGORY#"></td>
</tr>
<tr>
<td><div align="right">DESCRIPTION : </div></td>
<td><input type="text" name="descriptions" value = "#qCateg.DESCRIPTIONS#"/></td>
</tr>
<td> </td>
<td><input type="submit" name="Submit"/></td>
</tr>
</table>
</cfoutput>
<a href="searchcategory.cfm">Search Category</a>
</form>
<cfelse>
<cflocation url = "login.cfm" addtoken="no">
</cfif>
