MySQLi Update Record

Updating an existing record can be accomplished by using the Insert Record Server Behavior.

In the Server Behaviors panel (Window > Server Behaviors), click the plus (+) button and choose WebAssist > MySQLi > Data Management > Update Record from the pop-up menu.

 

General Tab

 

     

  1. Use the Trigger select list and associated Trigger Dynamic Data button to select the event in which your record will be updated.
    • Any Form Post: Any form posted to the current page that the server behavior is applied to triggers the data insert
    • Before Page Load: The data insert is triggered when the current page that the server behavior is applied to is loaded.
    • On Form Submit: Any form submitted on the same page that the server behavior is applied to trigger the data insert.
    • Button [button name] pressed: The server behavior is triggered if the specified button on the page is clicked.
    • Dynamic Data: Server-side code can be specified in the dynamic data interface (accessed through the lightning bolt) to create a trigger specific to your needs if one in the list does not meet your requirements
  2. Use the Connection and Update table menus to specify the database table that contains the record you wish to update..
  3. Use the Lookup column menu to specify the column that will be used to locate the record being update. This is most often the record ID.
  4. Use the Column type menu to specify the data type of the lookup column. In most cases, this will be preset for you - However, you can select any of the following:
    • Integer
    • Text
    • Date
    • Floating point number
  5. Use the Lookup value field and associated dynamic data button to select a value that will be used to select the record you wish to update.
  6. Use the After updating, go to field to select a page to redirect to after a successful record update.

Column Bindings Tab

The Column Bindings tab is where form values and/or other values (session, cookies, etc.) are designated for update in the table of your selection. Columns will be pre-populated for you based on the Table selected in the General tab.

  1. Enter the value you wish to update for the corresponding Column. Select the column you wish to bind a value to, and either enter a static value, a variable, or use the associated Dynamic Data button to select a value from Bindings.
  2. Make a selection in the Submit as list to designate the data type you will be updating. In most cases, this will be preset for you based on your column type. However, you can select any of the following:
    • Text
    • Integer
    • Double
    • Date
    • Checkbox Y,N
    • Checkbox 1,0
    • Checkbox -1,0
  3. Select the type of value used in the event that the Value you have selected is blank/null:
    • Empty String
    • Null
    • Db Default
    • Current Date
    • 0
    • N

After clicking OK, the Update Record Server Behavior will be applied to the current page. Changes can be made by editing the MySQLi Update Record Server Behavior from the Server Behaviors panel.