3.0.5

Blank page no results

Some Help plzzzzzzz I just fill the grid with a db query it return a blank page ..
<?php
require('DbConnection/DbConnet.php');
$query = 'SELECT * FROM tbllogin LIMIT 0,10';
$dataset = @mysql_query($query);


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

$rows = array();
while ($record = @mysql_fetch_row($dataset)) {
$cols = array();
foreach ($record as $value) {
$cols[] = '"'.addslashes($value).'"';
}
$rows[] = "\t[".implode(",", $cols)."]";
}
echo "[\n".implode(",\n",$rows)."\n];\n";
}

// print MySQL field names as javascript array
function aw_headers($dataset){
while ($field = @mysql_fetch_field($dataset)) {
$cols[] = '"'.$field->name.'"';
}
echo "[".implode(",",$cols)."];\n";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ActiveWidgets Examples</title>

<!-- fix box model in firefox/safari/opera -->
<style type="text/css">
.aw-quirks * {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
</style>

<!-- include links to the script and stylesheet files -->
<script src="../../runtime/lib/aw.js" type="text/javascript"></script>
<link href="../../runtime/styles/system/aw.css" rel="stylesheet">


</head>
<body>
<script type="text/javascript">

// insert javascript arrays produced by PHP functions
var myHeaders = <?= aw_headers($dataset) ?>
var myCells = <?= aw_cells($dataset) ?>

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

// set grid text
obj.setHeaderText(myHeaders);
obj.setCellText(myCells);

// set number of columns/rows
obj.setColumnCount(myHeaders.length);
obj.setRowCount(myCells.length);

// write grid to the page
document.write(obj);

</script>
</body>
</html>
Pascale
January 7,
If you're getting a pure blank page (absolutely nothing when you view source), then the problem exists with the PHP.

Try inserting..

<?php
[b]error_reporting(E_ALL);[/b]
require('DbConnection/DbConnet.php');
$query = 'SELECT * FROM tbllogin LIMIT 0,10';
$dataset = @mysql_query($query);


And then reload the page. If the errors in the page are recoverable, PHP should tell you a little bit more about why you're getting the blank white page.

Also, is your Database connection include file really named "DbConnet.php", and not "DbConnect.php"? Just a thought.
JohnW
January 8,
Just insert...

error_reporting(E_ALL);

Apparently you can't make things bold inside code blocks in this comment system.
JohnW
January 8,
10x ...I tried to put <?php ...?> instead of <?= ...?> ..It Works now
Pascale
January 12,

This topic is archived.

See also:


Back to support forum