get number of records from search criteria

Discussion in 'JavaScript' started by djkkenny, Dec 10, 2008.

  1. #1
    Anybody know of any scripts to replicate the search functionality on http://www.cargiant.co.uk ??

    If any1 can point me in the right direction to find how to do this in php+mysql that would be very helpful

    thank you?
     
    djkkenny, Dec 10, 2008 IP
  2. lp1051

    lp1051 Well-Known Member

    Messages:
    163
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Hi,

    to get the logic just view the source code. Then you now, that it's using AJAX to get the number of records from PHP/MySQL. On PHP you just create simple response with result of SQL query - such as "SELECT COUNT(*) FROM cars WHERE model='BMW';" If there is more searching parameters, you apply them into the query accordingly. In this case the php-mysql part is very simple and all the javascript front-end is visible on cargiant.co.uk. If you need more info, just search for any AJAX tutorial...
     
    lp1051, Dec 10, 2008 IP