Reputation: 73
I am trying to get this array as a result of mysql result.
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
Is it as simple as:
var availableTags [] = <php echo $result['availabletags']; ?> ;
Or should I do something else?
Upvotes: 0
Views: 88
Reputation: 1255
You can get your result by run of following query :
while( $row = mysql_fetch_assoc( $result)){
$new_array[] = $row; // Inside while loop
}
Let me know if you face any issue.
Upvotes: 1