:: Forum >>

why doesn't this simple example work?

<!-- include AW stylesheet and script -->
<link href="../../runtime/styles/xp/aw.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/aw.js"></script>

// insert javascript arrays produced by PHP functions
var myHeaders = ["id","workorderid","description","cost","chargetype","duration"];
var myCells = [
    ["57","50","small order","125","hourly","2"]

// create grid control
var obj = new AW.UI.Grid;

// set grid text

// set number of columns/rows

// write grid to the page


I am totally baffled...

Why doesn't this work? I have been able to get other examples working, but this one has me at the end of my wits.
Monday, June 18, 2007
I gave-up and just modified another example to do what I want, however I just realised that it is always skipping the first row of my data


$dsn = 'mysql://user:password@localhost/table';
$db =& MDB2::Connect( $dsn, array() );
if (PEAR::isError($db)) { die($db->getMessage()); }

$qry = "SELECT * FROM workorders";

$dataset = $db->query($qry);

// print MySQL query results as 2D javascript array
function aw_cells($dataset){

while ($record = $dataset->fetchRow(MDB2_FETCHMODE_BOTH)) {
foreach ($record as $value) {
echo $value;

can anyone tell me why it is skipping the first row of data from the table? I've simplified it as much as I can think.
Monday, June 18, 2007
i was calling fetch row once before in my set headers function. Just incase someone else has that problem.
Sunday, June 24, 2007

This topic is archived.

Back to support forum

Forum search