I'm self teaching myself to do MySQL and PHP. It is a new world to me, i have a couple of books and i do a lot of research on google before asking here. So I'm stuck with the following problem and I can't find an answer, I have a MySQL database, the database has a specific field called URL.
Part of the URL field looks like this:
&path=products&user=Mark24&id=2616
currently i have it set up so people can search for items in the database, and that works great. what i want to be able to add to the search feature is search by user. as you can see the user is in the middle of the entire url so i have this:
$query = "select Productid, Productname, url, from Products where Productid like '%$keyword%' or Productname like '%$keyword%' or url like '%$keyword%' ";
$result = mysqli_query($dbc,$query);
Now comes the real issue, ^^ this works wonders, people can actually search for the username and it will display exactly what i want. However if people search for the word "products" or "path" which is also in the url they will get over 2000 matches because every single url in my database has the word products and path. Why I want to avoid that? i don't want customers looking up our entire database, I'm also afraid of server overload because with each query a customer gets an image of the product, along with the product name and the link to the product. trying to load over 2000 pictures also slows down or crashes my browser, so i need to fix this somehow, but i'm not sure how to tackle it.
So is there a way to match only the part that says user="blah" for the URL field? do i do this with PHP, preg-match perhaps???
Any information provided is highly appreciated! Thanks.