Hi,
I have applied to the core the correct instructions in building a form and also the connector file and processor files in PHP. My codes are as below:
///////////////////////////////////////////////////
Table Creation Script
///////////////////////////////////////////////////
CREATE TABLE transp_type
(
transp_id
int(11) NOT NULL AUTO_INCREMENT,
transp_desc
varchar(10) NOT NULL,
comment
varchar(32) DEFAULT NULL,
PRIMARY KEY (transp_id
)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COMMENT=‘Transportation Types’;
///////////////////////////////////////////////////
My HTML File: transp_type.html
///////////////////////////////////////////////////
//Loading data from the database
myForm.load('transp_type.php?id=1');
//Data Processor Initialization
var mydp=new dataProcessor("transp_type.php?id=1");
mydp.init(myForm);
//Event Handlers in case of Button Clicks
myForm.attachEvent("onButtonClick", function(id)
{if(id=="save"){
myForm.save();}
else if(id=="fetch"){
myForm.load("transp_type.php?id=1");
}
}
)
}
</script>
///////////////////////////////////////////////////
My Form Definition XML File. trans_type.xml
///////////////////////////////////////////////////
<?xml version="1.0"?>
This is auto generated field
<item type="input" required="true" name="transp_desc" label="Description">
<note>Description of Transport Type</note>
</item>
<item type="input" name="comment" label="Comments, if any" rows="3">
<note>Additional information, if any</note>
</item>
<item type="block">
<item type="button" name="save" value="Save"/>
<item type="newcolumn"/>
<item type="button" name="fetch" value="Fetch" position="absolute"/>
</item>
///////////////////////////////////////////////////////
My PHP connector and data processor file. transp_type.php
///////////////////////////////////////////////////////
<?php
require_once("../codebase/dhtmlxconnector/codebase/form_connector.php");
$res=mysql_connect("localhost","root","");
mysql_select_db("sampleapp");
$conn = new FormConnector($res,“MySQL”);// connector initialization
$conn->set_encoding(“iso-88591-1”); //I added this seeing a forum solution for spl characters
$conn->render_table(“transp_type”,“transp_id”,“transp_id,transp_desc,comment”);
?>
////////////////////////////////////////////////////////////
The issue is that despite form getting rendered properly the data pulling and update are not working. Help me please. Matter Urgent. The errors displayed in the browser are in the attached PDF files for your reference.
Thanks in advance
Regards
Manish