Forum Moderators: coopster
Now I get into a new problem.I just slightly modify your code.
Please go thro' this code..
<?php
$conn=mysql_connect('localhost','root','');
mysql_select_db('univ',$conn);
$query="select * from enews";
$result=mysql_query($query,$conn);
$rows=mysql_num_rows($result);
$n = array();
for($i=0;$i<$rows;$i++)
{
$data=mysql_fetch_row($result);
$n[] = $data[0];
}
echo '<script type="text/javascript">';
echo 'var n = new Array("', join($n,'","'), '");';
echo '</script>';
?>
<script type="text/javascript">
var a=n.length
alert(n);
</script> // code is perfect upto this point.
Now I want to store this js array into a string as :
var str = "n[0]+ imagefile + n[1] + imagefile +.........+end of array"
How can I do this?
Please solve my problem
Thanks in advance
Ananthi.