ok i got a puzzle for you lol.
im trying to modify a Java/AJAX autocomplete Combo Box script to autocomplete an airport ICAO code which i have stored in the database, obviously for the script to suggest an autocomplete option it needs to know the suggestions i know how to get them from the database in PHP but i don't know how to place it into an array that Javascript can read?
the codes echos on a page: http://test.dth-scripts.com/VASystem/icaocodes/index.php
the code behind that page:
<?php
include "../config.php3";
include "../dbconnect.php3";
$a = "SELECT * FROM $table5";
$b = mysql_query($a)or die(mysql_error());
while ($row = mysql_fetch_array($b)){
$icao = $row['icao'];
$An = $row['AirportName'];
echo "$icao - $An,";
}
?>
and the format the javascript array is in:
var customarray=new Array('an apple','alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin');
so how the hell do i get the php query to place the results in the above javascript format?