I know this may be a duplicate, but I cant wrap my brain around the other examples. Help would be appreciated. I have a php array that i need to assign to a javascript array. Here is my amateur way of doing it now. You can see source at http://www.preferweb.com/accentps/index.php
<?php
$i=0;
while ($result1 = mysql_fetch_array($query1)){
print "<script>";
print "var size[".$i."]=" .$result1['type'].";
";
print "var 25[".$i."]=" .$result1['25'].";
";
print "var 50[".$i."]=" .$result1['50'].";
";
print "var 100[".$i."]=" .$result1['100'].";
";
print "var 250[".$i."]=" .$result1['250'].";
";
print "var 500[".$i."]=" .$result1['500'].";
";
print "var plus[".$i."]=" .$result1['plus'].";
";
$i = $i+1;
}
print "var tick='1';
";
print "alert (tick);
";
print "</script>
";
?>
<script>
alert (500[0]);
</script>
This alerts undefined for the tick alert and nothing for the second alert.. Thanks..