Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query the database with results on time

    Hello guys,

    I have a question, I wonder how the system query the database that uses facebook, in the text field (search for people, places and things) that the person poses a name of another person and now works various results appear at the same time. How can I do this query and display the results in real time that way?

    I thank you for the help in advance.

  • #2
    Regular Coder MrBiggZ's Avatar
    Join Date
    Apr 2005
    Location
    Indianapolis IN
    Posts
    275
    Thanks
    39
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by pravinganore View Post
    Hello guys,

    I have a question, I wonder how the system query the database that uses facebook, in the text field (search for people, places and things) that the person poses a name of another person and now works various results appear at the same time. How can I do this query and display the results in real time that way?

    I thank you for the help in advance.
    Fairly easy!

    With out writing any code which you'll need to.

    1) Put the current time in a variable ( example: $begintTime = microtime(true); )

    2) Do your query

    3) Put the end time in a variable ( example: $endTime = microtime(true); )

    4) Do some math ( example: $queryTime = $endTime - $beginTime; )

    5) Display some thing like (example: echo "Your query took $queryTime seconds"; )

    Obviously you'd probably want to add how many results where returned as well. But this shows you a very basic way to get the amount of time. I'm sure there is a more sophisticated way to skin the cat!

    Good Luck!
    “No matter how slick the demo is in rehearsal, when you do it in front of a live audience, the probability of a flawless presentation is inversely proportional to the number of people watching, raised to the power of the amount of money involved.” ~ Mark Gibbs

  • #3
    Regular Coder
    Join Date
    Sep 2011
    Posts
    408
    Thanks
    18
    Thanked 26 Times in 26 Posts
    Quote Originally Posted by MrBiggZ View Post
    Fairly easy!

    With out writing any code which you'll need to.

    1) Put the current time in a variable ( example: $begintTime = microtime(true); )

    2) Do your query

    3) Put the end time in a variable ( example: $endTime = microtime(true); )

    4) Do some math ( example: $queryTime = $endTime - $beginTime; )

    5) Display some thing like (example: echo "Your query took $queryTime seconds"; )

    Obviously you'd probably want to add how many results where returned as well. But this shows you a very basic way to get the amount of time. I'm sure there is a more sophisticated way to skin the cat!

    Good Luck!
    Swing and a miss.

    If you read what he's asking, he's asking how to create the search feature. I've never done this but I'm sure someone else has and knows what to do.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •