I have a query that uses LIKE to get items with the same id, located in a given category.
Problem is that using LIKE I can only get so close in terms of accuracy.
Here's what I mean.
$id = 22
Now I have table in my database that has each unique id on a new line.
2
32
3
22
This is my query:
$get= mysql_query "SELECT * FROM inventory where id LIKE '%$id%"
Only the first and last characters need to match in order for result to be returned, using this query.
By now you see that this has some problems. Mainly to do with the fact that 22 will return a result for items located in category 2.
I've tryed a few diffenrent ways to get this working but so far nothing i've done seems to work.
If there's some way I could include new line in that search for a lil bit more accuracy I think I could get it to work as i'd like.
Any help is appreciated.