<?php
// PDO connect *********
/*function connect() {
    return new PDO('mysql:host=localhost;dbname=bikers_bigs', 'bigs', 'Bismillah', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
}

$pdo = connect();*/
include('config/koneksi2.php');

$pemesan =$_POST['pemesan'];
$sql = mysql_query("SELECT * FROM toko WHERE nama LIKE '%$pemesan%' ORDER BY kode ASC limit 5");
/*$query = $pdo->prepare($sql);
$query->bindParam(':keyword', $keyword, PDO::PARAM_STR);
$query->execute();
$list = $query->fetchAll();*/

while($rs=mysql_fetch_array($sql))
{
	// put in bold the written text
	$country_name = str_replace($_POST['pemesan'], '<b>'.$_POST['pemesan'].'</b>', $rs['nama']);
	// add new option
    echo '<li onclick="set_toko(\''.str_replace("'", "\'", $rs['nama'] ).' / '.str_replace("'", "\'", $rs['kode'] ).'\')">'.$country_name.' / '.$rs['kode'].'</li>';
}
?>