Log in

View Full Version : search problem



purnendu2311
10-19-2007, 07:19 AM
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

tech_support
10-19-2007, 07:26 AM
Just before the SQL statement, put


$isbn = str_replace('-','',$isbn);


And please, use a more descriptive title next time.

purnendu2311
10-19-2007, 08:05 AM
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

tech_support
10-19-2007, 09:27 AM
See the edit. I put _ instead of -

purnendu2311
10-19-2007, 09:39 AM
Hi,
thanks i got solve..

Thanks for helping

Regards,
Ranjan