Hi,
The script below works but within the PHP section I only want to load the data from mySQL in the myarr[] javascript array. I don't want to display it. Is there anyway of doing this?
<script language="javascript">
<!--
var myarr = new Array();
// -->
</script>
</head>
<body>
<?php
// connect and get data ...
//
echo("<script language=\"javascript\">\n");
echo("<!-- \n ");
for ($i=0; $row=mysql_fetch_row($result); $i++){
echo ("document.write(myarr[" . $i . "] =" . "'" . $row[2] . "'" . ");");
}
echo("// --> \n");
echo("\n</script>");
?>
// display the data
<script>
<!--
for (var i=0; i<myarr.length; i++) {
document.write(myarr + "<br />");
}
// -->
</script>