SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    bahrain
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    serching from database of particular string

    hi
    i want to search from database against some name e.g if from my page i send "john" to search from database so it shows me all names in which jhon comes e.g all like john micheal,shaun john,shaun john micheal etc.
    plz its urgent
    regards

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    on your form have an input called q
    Code:
    <input type="text" name="q">
    On your search results page..
    PHP Code:
    $q $_GET['q'];

    $search mysql_query("select name from mytable where name LIKE '%q%'");
    $result_rows mysql_fetch_assoc($search); 
    Then echo the results
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    bahrain
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx a lot SpikeZ.its really helpful
    can u help me plz im my second question tooo i posted on the same day plz.
    hope u wll
    thanx again
    regards


Bookmarks

Posting Permissions

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