hello
i have successfully passed a php variable ($num_rows) to javascript yet im having trouble passing a php array ($px_x_array) to javascript.
id appreciate your help.
cheers
termy
<?php
//num_rows
$query = "select px_x from object where number=$what";
$result = safe_query($query);
$num_rows = mysql_num_rows($result);
//object_px_x make array
$query="select px_x from object where number=$what";
$result = safe_query($query);
$i=0;
$px_x_array = array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
while (list ($key, $value) = each($row))
array_push($px_x_array, $row["px_x"]);
$i++;
}
}
?>
<SCRIPT LANGUAGE=JavaScript>
<!--
var jsnum_rows = "<?echo($num_rows)?>";
for(i=0;i<10;i++){
var jspx_x = "<?$px_x_array[$i]?>";
flashMovie = "ice_view_swf3.swf?num_rows=" +jsnum_rows + jspx_x;
alert(flashMovie);
}
//-->
the result i get is that jspx_x does not return any values.