Hi
I found this code in internet, and i want to used it , but my database is mysql not mysqli, how can I change my syntax.
<?php $db = new mysqli('DB_HOST', 'USERNAME' ,'PASSWORD', 'DATABASE_NAME');
if(!$db) {
echo 'Could not connect to the database.';
} else {
if(isset($_POST['queryString'])) {
$queryString = $db->real_escape_string($_POST['queryString']);
if(strlen($queryString) >0) {
$query = $db->query("SELECT country FROM countries WHERE country LIKE '$queryString%' LIMIT 10");
if($query) {
echo '<ul>';
while ($result = $query ->fetch_object()) {
echo '<li onClick="fill(\\''.addslashes($result->country).'\\');">'.$result->country.'</li>';
}
echo '</ul>';
} else {
echo 'OOPS we had a problem <IMG class=wp-smiley alt=:( src="http://www.wavesdream.com/wp-includes/images/smilies/icon_sad.gif"> ';
}
} else {
// do nothing
}
} else {
echo 'There should be no direct access to this script!';
}
} ?>
Thank you