This question already has an answer here:
Referring to the title. I have an array which I coded like this:-
$query = "SELECT * FROM server";
$result = mysql_query($query);
$dServer = array();
while($row = mysql_fetch_assoc($result))
{
$dServer[] = $row['model'];
}
Now, how do I pass the $dServer array into a Javascript array?
For example, this array:
var a = new Array();
a
a string rather than a variable defined by JSON. – jprofitt Apr 19 '12 at 2:04