PHP Code
When I run this code all I get back is the main select statement.
I have downloaded the latest PHP connector but the set_options code is not returning any paired data. If I comment out set_options I get the same data returned.
[code]<?php
require_once(“…/codebase/connector/options_connector.php”);// includes the appropriate connector
require_once(“…/codebase/connector/grid_connector.php”);//includes related connector file
$dbConn=mysql_connect(“host”,“username”,“password”);//connects to server containing the desired DB
mysql_select_db(“australia”);
$staffGrid = new GridConnector($dbConn,“MySQL”); // connector initialization
$staffGrid->enable_log(“STAFF.LOG”, false);
$location = new OptionsConnector($dbConn,“MySQL”);
$location->render_sql(“SELECT ID as value, LOCATION as label from tblLocations”,“ID”,“ID(value),LOCATION(label)”);
$staffGrid->set_options(“LOCATION”,$location);
$staffGrid->render_table(“tblStaff”,“ID”,“LASTNAME,FIRSTNAME,PROJECT,POSITION,CONTACT_NO,LOCATION,EMAIL”);
?>[/code]
LOG File
====================================
Log started, 31/08/2014 09:08:28
====================================
SELECT `ID`,`LASTNAME`,`FIRSTNAME`,`PROJECT`,`POSITION`,`CONTACT_NO`,`LOCATION`,`EMAIL` FROM tblStaff
Done in 0.002000093460083s
====================================
Log started, 31/08/2014 09:11:04
====================================
SELECT `ID`,`LASTNAME`,`FIRSTNAME`,`PROJECT`,`POSITION`,`CONTACT_NO`,`LOCATION`,`EMAIL` FROM tblStaff
Done in 0.003000020980835s
====================================
Log started, 31/08/2014 09:11:05
====================================
SELECT `ID`,`LASTNAME`,`FIRSTNAME`,`PROJECT`,`POSITION`,`CONTACT_NO`,`LOCATION`,`EMAIL` FROM tblStaff
Done in 0.00099992752075195s
Returned XML
[code]This XML file does not appear to have any style information associated with it. The document tree is shown below.