OK, is your javascript embeded into the page <script>javascript code here</script> or <script scr="javascript.js"></script>? If it's the first, you can just add PHP code into that to get the contents and make the array that way.
an example of that would be
PHP Code:
<script type="text/javascript">
<?php
$num = 0;
$result = mysql_query("SELECT name, discount FROM coupons");
while ($result = mysql_fetch_assoc($result))
{
if ($num != 0)
{
$coupon_name .= ',';
$coupon_value .= ',';
}
$coupon_name .= "\"".$result['name']."\"";
$coupon_value .= $result['discount'];
}
?>
var coupons = array(<?php echo $coupon_name ?>);
var coupdc = array(<?php echo $coupon_value ?>);
</script>