PHP MySQL Example Errors
Hi, I'm trying to pull data from a MySQL database using PHP and the example at http://www.activewidgets.com/grid.examples/php-mysql.html. While I do see my recordset populated into a JSON table in the generated HTML, the grid does not display at all and I've found the following issues, the first has been resolved but I am stuck on the second one:
1. These two lines are incorrect (or don't work in Firefox at least):
var myHeaders = <?= aw_headers($dataset) ?>
var myCells = <?= aw_cells($dataset) ?>
They both give me an invalid xml error in the error console, these changes in bold fixed this issue:
var myHeaders = <?php aw_headers($dataset) ?>
var myCells = <?php aw_cells($dataset) ?>
2. This line also gives an error:
echo "[".implode(",",$cols)."];\n";
Error reported in error console and generated in html:
Error console: Invalid flag after regular expression
HTML:
<b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in <b>C:\htdocs\mewp\aw_dyncontacts.php</b> on line <b>59</b><br />
I'm fairly new to php, mysql, and javascript and I'm a bit lost here - any ideas?
1. These two lines are incorrect (or don't work in Firefox at least):
var myHeaders = <?= aw_headers($dataset) ?>
var myCells = <?= aw_cells($dataset) ?>
They both give me an invalid xml error in the error console, these changes in bold fixed this issue:
var myHeaders = <?php aw_headers($dataset) ?>
var myCells = <?php aw_cells($dataset) ?>
2. This line also gives an error:
echo "[".implode(",",$cols)."];\n";
Error reported in error console and generated in html:
Error console: Invalid flag after regular expression
HTML:
<b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in <b>C:\htdocs\mewp\aw_dyncontacts.php</b> on line <b>59</b><br />
I'm fairly new to php, mysql, and javascript and I'm a bit lost here - any ideas?
Jeremy Savoy
January 19,