Note that there are some explanatory texts on larger screens.

plurals
  1. POCFUPDATE - Updating the database
    primarykey
    data
    text
    <p>A pretty newbie question again. I have a form that retrieves record values for updating.</p> <p>It pulls through records fine however when I click the update button, you are taken to the action page where it displays the success message. However no data has been updated in the database it self?</p> <pre><code> &lt;CFUPDATE Datasource="XXXXX" Tablename="Suppliers"&gt; UPDATE Suppliers SET SupplierName=?, Address1=?, Address2=?, City=?, WHERE SupplierCode = #txtSupplier# &lt;/CFUPDATE&gt; </code></pre> <p>Is this the wrong set up? Im a little unsure how to pass the primary key so that may be the error here!</p> <p>I am capturing data in this way:</p> <pre><code>&lt;CFQUERY name="GetRecord" datasource="XXXX"&gt; SELECT SupplierName, Address1, Address2, City, PostCode, SalesRepName, SalesRepPhone, SalesRepEmail, PaymentTerms, Notes FROM Suppliers WHERE SupplierCode = '#txtSupplier#' &lt;/CFQUERY&gt; &lt;cfoutput&gt; &lt;H4&gt;You can update supplier details here. Please note, any fields containing characters not permitted will display an error&lt;/H4&gt; &lt;form action="supplier_updated.cfm?code=#txtSupplier#" method="post"&gt; &lt;input type="Hidden" name="SupplierCode" value="#txtSupplier#"&gt;&lt;br&gt; Update Supplier Name:&lt;INPUT TYPE="text" NAME "SupplierName" VALUE="#Trim(GetRecord.SupplierName)#"&gt; &lt;BR&gt; &lt;P&gt;The Supplier Code for the Supplier you wish to edit is: #txtSupplier#&lt;/P&gt; &lt;BR&gt; Address Line 1: &lt;INPUT TYPE="text" NAME "Address1" VALUE="#Trim(GetRecord.Address1)#" SIZE="35" MAXLENGTH="100"&gt; &lt;BR&gt; Address Line 2: &lt;INPUT TYPE="text" NAME "Address2" VALUE="#Trim(GetRecord.Address2)#" SIZE="35" MAXLENGTH="100"&gt; &lt;BR&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload