Results 1 to 5 of 5

Thread: search problem

  1. #1
    Join Date
    Apr 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default search problem

    Hi,

    I have written one query to search the ISBN number from my database table...
    Once i am search ISBN number(81-87409-61-4: it is there in database), then i am getting good result..
    But i want same result after searching this number(8187409614). I want to say once i am removing
    the hyphen i am not getting the result...


    $str1="select * from books where isbn like '%$isbn%' order by bid desc LIMIT $offset, $rowsPerPage";

    plz any body can help me out..

    Regards,

    Ranjan

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Just before the SQL statement, put
    PHP Code:
    $isbn str_replace('-','',$isbn); 
    And please, use a more descriptive title next time.
    Last edited by tech_support; 10-19-2007 at 09:26 AM.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Apr 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    still i am not getting the result..
    Let me define my question, i have 81-87409-61-4 value in isbn field of my database table. once i am searching with 81-87409-61-4 value, i am getting
    one record as my search result. But once i want to search by 8187409614(just i
    am removing the hyphen) value I am not getting the search result. here i want
    same result after search either 81-87409-61-4 or 8187409614..
    plz help me..

    Regards

    Ranjan

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    See the edit. I put _ instead of -
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    Apr 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    thanks i got solve..

    Thanks for helping

    Regards,
    Ranjan

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
  •