i have some trouble to load my form with data in my DB ( DB2 )
Here is my code
load.php
[code]<?php
/*
* Tableau des options de configuration de la base DB2
*/
$options = array ();
$options['i5_naming'] = true ;
$options['i5_libl'] = array() ;
$options['DB2_ATTR_CASE'] = 'UPPER' ;
require_once '../dhtmlxConnector/codebase/dataprocessor.php';
require_once '../dhtmlxConnector/codebase/form_connector.php';
require_once 'macaronDB/classes/pdo_connect.php';
$ipa = '*LOCAL' ;
$usr = 'XXXXX' ;
$pwd = 'XXXXX' ;
$cnx_db01 = new pdo_connect($ipa, $usr, $pwd, $options ) ;
$sql = "select * from M400F.ART fetch first 1 rows only";
$stat = pdo_connect::getStatement($cnx_db01, $sql);
$result = pdo_connect::getFetchAssoc($stat);
//create connector for dhtmlxForm using connection to mySQL server
$form = new FormConnector($cnx_db01);
//table name, id field name, fields to use to fill the form
$form->render_table("M400F.ART","ARTNUM","ARTNUM, ARTDEP, ARTLIB");[/code]
I have an internal server error. The connection works but i don’t know how to load the form with a specifical wrapper
Server side script expects that data for the form will be requested like next
some.php?id=123
where 123 - id of form record. If you are calling script without id parameters - it is not clear which record must be loaded and server side code throws the above error.
You have the id of record in DB ( ARTNUM ), right ?
And when you want to show data in the form - you want to show the data of some specific record, right ? So you probably have this id on client side ( as selected row in grid, or in some js var )
Thank you Stanislav,the mysql connection works
But now i want to change the connection and for example i want to use db_oracle.php. What do I must change in load.php to have a different connection ? Because i always have a mysql error in the log…