/MY CODE/
The if part is working properly but else is not working. i even tried $variable instead of direct echo but still it is not working 'else'
Updated
    <?php
   $db = new mysqli('localhost', 'root' ,'', 'timeline');
    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 collegename FROM college WHERE collegename LIKE '$queryString%' LIMIT 10");
                if(isset($query)) {
                echo '<ul>';
                    while ($result = $query ->fetch_object()) {
                        echo '<li onClick="fill(\''.addslashes($result->collegename).'\');">'.$result->collegename.'</li>';
                    }
                echo '</ul>';
                } else {
                    echo 'create some'; // this part is not working
                }
            } else {
                // do nothing
            }
        } else {
            echo 'There should be no direct access to this script!';
        }
    }
?>
help me out..... even read lots of like problem on stackoverflow but no real return
 
     
    