I have linked to the appropriate ajax library for autocomplete and jquery. Here is the script
jQuery(document).ready(function($) {
$("#tag").autocomplete("data.php", {
selectFirst: true
});
});
and my data.php file
$q = $_GET["q"];
$my_data=mysql_real_escape_string($q);
$sql="SELECT comname FROM wp_birds WHERE comname LIKE '%$my_data%' ORDER BY comname";
$result = mysql_query($sql) or die(mysql_error());
if($result)
{
while($row=mysql_fetch_array($result))
{
echo $row['comname']."
";
}
}
and my form
<label>Tag:</label>
<input name="tag" type="text" id="tag" size="20"/>
the data.php file is successfully loading the array of comnames however when i input i'm getting nothing...