I have created a form that is bound to a database. The form loads properly. When I save the form, instead of updating the existing record, a new record is appended to the database.
I have tried several things:
-changing dhxForm.save() to dp.save()
-dropping the settransactionmode statement
-dropping the id parameter on the dataprocessor init
-switching between render_table and render_sql (with a built-in where clause)
I’m not sure what I’m missing. Any suggestions appreciated.
Here is index.html
Here is form.xml
<?xml version="1.0"?> <items> <item bind="fullname" type="input" name="fullname" value="" label="Full Name"/> </items>
Here is data.php
<?php require_once("config.php"); $res=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD); mysql_select_db(DB_DATABASE); require_once("dhtmlxForm/codebase/connector/form_connector.php"); $form = new FormConnector($res); $form->render_table("contacts","id","fullname"); ?>