Hey,
I want to make a search bar in my site. Well i have the search bar made and it posts to find.php. Now i need to no how to get that info from the database. I was thinking of doing this:
and then just do a while() function and so on. But i want to know if lets say the person enters in "php for dummies" and there is something in the database called php & mysql for dummies. will that not come up because it is not an exact match. How can i get more results if there is not an exact match? thanks in advance.
I want to make a search bar in my site. Well i have the search bar made and it posts to find.php. Now i need to no how to get that info from the database. I was thinking of doing this:
| Code: |
|
<?php $item = $_POST['item']; $sql = "SELECT item_name FROM sales WHERE item_name='$item'"; $resource = mysql_query($sql); $row = mysql_fetch_array($resource); |
and then just do a while() function and so on. But i want to know if lets say the person enters in "php for dummies" and there is something in the database called php & mysql for dummies. will that not come up because it is not an exact match. How can i get more results if there is not an exact match? thanks in advance.
