charvie 0 Newbie Poster

I don't know what's the problem with this code. I've tried it on chrome and it worked. but in IE it isn't

Jquery code

$().ready(function() {


	$("#loc").autocomplete("database.php", {
		width: 260,
		selectFirst: false
	});

});

HTML code

<label>Location</label>
			<input type="text" id="loc" />
    <h3>Result:</h3> <ol id="result" style="border:1px solid red;"></ol>

PHP code

$term = strtoupper($_GET["q"]);


$query = mysql_query("SELECT * from  entityspecs where entitycode like '%$term%' ") or die(mysql_error());


$res = array();

while($row = mysql_fetch_assoc($query)){
	
	$enty = $row['entitycode'];
	$res[$enty] = $enty;
	
	
}
	

foreach ($res as $key=>$value) {
	if (strpos(strtoupper($key), $term) !== false) {
		echo "$key|$value\n";
	}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.