#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    40
    Rep Power
    2

    Live Keyword Search


    Good morning programmers,

    I'm looking to create a live keyword search using PHP, MySQL, and Javascript.

    I have a pagination script which works fine.

    How would one create a form that allows users to fill in a form and results are produced after pushing send without refreshing the page?

    Is this possible to do with PHP alone, or would I need to use something like Javascript and / or jQuery?

    Thanks
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    You have to use JavaScript.

    jQuery is a JavaScript library, you can use it or not. It makes writing JavaScript easier, but there is nothing you can do with jQuery that you can't do with regular JavaScript.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    40
    Rep Power
    2

    Re:


    Would that require the use of XML as well?

    I want to do something alone the lines of

    SELECT * from $tbl_name WHERE Description=$_GET['search']

    Does this look right?
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    You don't have to use XML. You do need some way of transferring the results from your PHP code to your JavaScript code, and XML is one option for doing that, but you could also use JSON or HTML instead.

    Conceptually the query makes sense, but you would want to correctly escape the values coming from $_GET and add quotation marks so that the query is syntactically valid.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo