Results 1 to 4 of 4

Thread: Search Query

  1. #1
    Join Date
    Jan 2012
    Posts
    19

    Unanswered: Search Query

    i am making a simple CMS in which any one can get freely use it but i am in search of a search query i mean i have a search box

    i want to implement a site

    i have a database table in which all the serials stored..
    so the table column name is serial name

    i want a query please write some one for me .

    select * from serials where s_name like ''

    i don't know what to write in single quote

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    WHERE  s_name LIKE '%searchterm%'
    Where % is a wildcard and "searchterm" is the s_name you're looking for.
    George
    Home | Blog

  3. #3
    Join Date
    Jan 2012
    Posts
    19
    are u sure there will not any injection in this query ?
    or i have to use urlencode('searchterm') store in variable and then pass it in query ?

    because last time i was inserting a value in database when i use 3 single quote in insertion the php file crash and give error so i use url encode i am asking u that isn't there any injection work ////

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

Posting Permissions

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