I want to pass mysql_fetch_array() 's result array to javascript function.
Here is a code.
<?php
$msDetails= mysql_query("select * from article_master where status='complete'") or die(mysql_error());
while ($row= mysql_fetch_array($msDetails)) {
$co_auth_name=mysql_query("select fname from author_detail where journal_id='$jid' && article_id='$row[1]' && (correspondng_author != 'on' || correspondng_author = 'false')");
$num=mysql_affected_rows();
echo $num; //2
while ($co_auth=mysql_fetch_array($co_auth_name))
{
$JArray= json_encode($co_auth);;
echo $JArray;
}
?>
<tr>
<td><a href="javascript:popup_viewReports('<?php echo $JArray ?>');">View</a>
</td>
</tr>
<?php
}
?>
How can i pass $co_Auth to viewReports()??