I am having trouble using the Options Connector.
Is there something i am missing. Below is the code
HTML File:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Filtering and Autocomplete mode</title>
<script>
window.dhx_globalImgPath="../dhtmlx_suite/common/imgs/";
</script>
<link rel="stylesheet" href="../dhtmlx_suite/dhtmlxConnector/samples/common/dhtmlx.css" type="text/css" charset="utf-8">
<script src="../dhtmlx_suite/dhtmlxConnector/samples/common/dhtmlx.js" type="text/javascript" charset="utf-8"></script>
<script src="../dhtmlx_suite/dhtmlxConnector/codebase/connector.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="../dhtmlx_suite/dhtmlxLayout/codebase/dhtmlxlayout.css">
<link rel="stylesheet" type="text/css" href="../dhtmlx_suite/dhtmlxLayout/codebase/skins/dhtmlxlayout_dhx_web.css">
<script src="../dhtmlx_suite/dhtmlxLayout/codebase/dhtmlxcommon.js"></script>
<script src="../dhtmlx_suite/dhtmlxLayout/codebase/dhtmlxcontainer.js"></script>
<script src="../dhtmlx_suite/dhtmlxLayout/codebase/dhtmlxlayout.js"></script>
<link rel="stylesheet" type="text/css" href="../dhtmlx_suite/dhtmlxForm/codebase/skins/dhtmlxform_dhx_skyblue.css">
<script src="../dhtmlx_suite/dhtmlxForm/codebase/dhtmlxcommon.js"></script>
<script src="../dhtmlx_suite/dhtmlxForm/codebase/dhtmlxform.js"></script>
</head>
<body onload="doOnLoad();">
<div id="parentId" style="position: relative; top: 20px; left: 20px; width: 600px; height: 10px; aborder: #B5CDE4 1px solid;"></div>
<script type="text/javascript">
var dhxLayout, dhxList, dhxForm;
dhxLayout = new dhtmlXLayoutObject();
</script>
<form action="" method="get" accept-charset="utf-8" id="my_form">
<input type="button" command="" value="Does Nothing">
</form>
<script type="text/javascript">
formData = [
{type: "radio", name: "choose", value: "online", label: "Link to existing Node",
list:[
{type: "select", name: "bootleg", label: "Test", connector: "options2.php"}
]},
{type: "radio", name: "choose", value: "senddisk", label: "Define new Node Properties", checked: true, list:[
{type: "checkbox", name: "bootleg2", value: "yes2", label: "Insert bootleg2", checked: true},
{type: "checkbox", name: "lirycs2", value: "jaja2", label: "Lyrics if possible2", checked: true}
]}
];
var dhxForm = new dhtmlXForm("my_form", formData);
dhxLayout.attachObject("my_form");
</script>
</body>
</html>
option2.php File
<?php
require_once('../dhtmlx_suite/dhtmlxForm/codebase/connector/options_connector.php');
require_once('../dhtmlx_suite/dhtmlxForm/codebase/connector/form_connector.php');
require_once('../dhtmlx_suite/dhtmlxForm/codebase/connector/dataprocessor.php');
$host="127.0.0.1";
$username="user1";
$password="enter";
$db_name="dhtmlx_db";
$res=mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name");
$options = new SelectOptionsConnector($conn);
$options->enable_log("log.txt");
$options->render_sql("SELECT taskName FROM tasks","","taskName");
?>
The log.txt file has:
====================================
Log started, 29/07/2011 07:07:18
SELECT taskName FROM tasks
mysql_query() expects parameter 2 to be resource, null given at C:\Program Files\EasyPHP-5.3.3\www\dhtmlxSuite_web\dhtmlx_suite\dhtmlxForm\codebase\connector\db_common.php line 796
mysql_fetch_assoc() expects parameter 1 to be resource, null given at C:\Program Files\EasyPHP-5.3.3\www\dhtmlxSuite_web\dhtmlx_suite\dhtmlxForm\codebase\connector\db_common.php line 802
Done in 0.012878894805908s