Hi,
I’m following this viewtopic.php?f=6&t=18910
I’d like to know if it is possible to have options from array (not from SQL) using connector.
Actually, I have an XML Form like :
<?xml version="1.0"?>
<items>
<item type="select" name="myId" connector="load_data/connectors/foo.php" bind="myId" label="Foo"/>
<item type="button" command="send" value="Save"/>
</items>
My first PHP connector was :
<?php
/**
* @author : xxxx
* ...
*/
require_once("Common/dhtmlxConnector_v10_php/codebase/options_connector.php");
$res=mysql_connect(DEFAULT_MYSQL_SERVER.":".DEFAULT_MYSQL_PORT,DEFAULT_MYSQL_USER,DEFAULT_MYSQL_PASSWORD);
mysql_select_db("myDb");
mysql_query("set names 'utf8'");
$options = new SelectOptionsConnector($res);
$sql = "select myId,label from foo";
$options->render_sql($sql,"myId","myId,label");
?>
This works fine, but I can’t choose a blank value for “Foo” in my Form.
So, i would like to put a blank value in my select but I really don’t know how to do that. All the samples i’ve been studying seems out of my scope.