jQuery Tutorial: jQuery Autocomplete With Ajax & PHP & MySQL




In this jQuery Tutorial, you will learn How To Create jQuery AutoComplete. Download Source Code: …

Original source


32 responses to “jQuery Tutorial: jQuery Autocomplete With Ajax & PHP & MySQL”

  1. I have this error:
    Fatal error: Uncaught Error: Call to undefined method PDO::real_escape_string() in C:xampphtdocstemplateindex.php:7 Stack trace: #0 {main} thrown in C:xampphtdocstemplateindex.php on line 7
    line 7: $q = $connection->real_escape_string($_POST['q']);
    can i help me please. thanks

  2. Thanx for the tutorial. How can I make other input fields react to what one writes in a first input field? Say in Input 1 I enter user ID, and the rest of the Inputs complete with associated info. If someone can help me, I would very much appreciate it!

  3. Hi Senaid. Thanks for your amazing TUT's 😉 !

    I've one Question:

    How can i add keyboard support for the autocomplete ul li List.
    I want to use the UP and DOWN button and also the ENTER button for Selecting one "Country" this would be very usefulf.

    Thank's

  4. Hi, great channel and tutorials! 🙂 Just a quick question: how would you navigate through the drop down results using your up/down arrows on your keyboard, for example? If you have any video where you explain this, please share a link. Thanks! 🙂

  5. $(document).on('click', 'li', function () {
    var sire = $(this).text();
    $("#sire").val(sire);
    $("#sireList").html("");
    });

    ako imaš dva ili više inputa sve ti onclick zapuni sa istim value. Jel je možda krivo to da treba onclick function dat neko ime?

    istalo mi sve radi, samo onclick treba da rješim.

  6. Hey, thanks for adding this tutorial. It is working great. But I have one question. If I want to add another searchBox and I define also 2 searches from database (for example I have table with names and gender), When I put in SELECT FROM table WHERE name LIKE %$q% AND gender=male and in other search gender female I receive back correct search (everything is working) but when I click on one of result both searchBox get the same result. For example I click on searchBox1 on result John both of searchBox fill in with click Result. Can you help me solve this problem.

  7. Hello Senaid. Would that be possible to show data from the column 'name' in a list and div as you already did, AND the column 'id' in a paragraph tag at the same time? I am not trying to waste your time as you must be a very busy person, but what would you recommend me to accomplish that? I reuse your code for my own database successfully, and I wish I would know how to feed two different HTML elements with data from two different columns. If I learn it I would probably know how to add more if necessary. Thank you! PS. Please, don't need to answer me if you're busy or for any other reason. 🙂

  8. I have done your lesson. But at step connection, i used:
    "$tenmaychu='localhost';
    $tentaikhoan='root';
    $pass='';
    $csdl='khonha';
    $conn=mysql_connect($tenmaychu,$tentaikhoan,$pass,$csdl) or die('Không kết nối được!');
    mysql_select_db($csdl,$conn);
    $q=mysql_real_escape_string($_POST['q']);
    $sql = "select name from tinhthanh where name like '%$q%'";
    $run=mysql_query($sql);
    if(mysql_num_rows($run) >0) {…
    follow your step, my laptop annouced errors many times.

Leave a Reply