I am being stumped over this problem, and I can't seem to figure it out, hoping someone here can do make heads or tails over this.
When I use the following to query my database:
$q = "SELECT * FROM items WHERE (searchable='1' and title LIKE'%".$_srch."%')";
the items show up they way they are supposed to. But when I add limit 10, 5
to the end:
$q = "SELECT * FROM items WHERE (searchable='1' and title LIKE'%".$_srch."%') limit 10, 5";
The query shows up nothing. I have tried everything I can think of, but I must have missed something. Someone help?
Thanks
By using LIMIT 10, 5
you're stating that you want the database to start displaying from the 11th row, and display 5 rows. (11th, 12th, 13th, 14th, 15th) - It might be possible that you actually, don't have enough rows.
Try something like, LIMIT 0, 5
- this will display the first 5 rows from the beginning, but 10, 5 will only work if you have more than 10 rows for the search query.
Read more here: http://www.mysqltutorial.org/mysql-limit.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With