Possible Duplicate:
pass php array to javascript function
Pass PHP array into Javascript array
I got problem pass the PHP data to Javascript. I need to transfer the addr column to array then pass array to Javascript , how can i fetch it out of PHP then use array in Javascript? thank you
<?php
require_once 'Common/system_start.php';
$sql="select addr from tab_mem order by sn desc ";
$result= mysql_query($sql);
$data=mysql_fetch_assoc($result);
$row=mysql_num_rows($result);
$n = array();
for($i=0;$i<$rows;$i++)
{
$data=mysql_fetch_row($result);
$n[i] = $data[i];
}
?>