PHP Code:
<?php
$increase = 0;
$increase2 = 0;
while (sqlsrv_fetch( $stmt )) {
$differentvalue[]= sqlsrv_get_field( $stmt, 0, SQLSRV_PHPTYPE_STRING( SQLSRV_ENC_CHAR));
$value[] = sqlsrv_get_field( $stmt, 1);
$anothervalue[]= sqlsrv_get_field( $stmt, 2);
$increase++;
}
echo "<script type=\"text/javascript\">\nvar ARRAY_NAME=new Array();\n";
while ( $increase2 < $increase) {
echo "ARRAY_NAME[$increase2] = $value[$increase2];\n";
$increase2++;
}
?>
I think this would do it this is for a microsoft sql server though might need some alerting if different
Bookmarks