I have a mysql query with a LIMIT 5. This works fine, and it shows only 5.
But I can't put a variable in this query. I have written $entries='10'; earlier and then written LIMIT $entries. This doesn't work, and I have also tried LIMIT '$entries' and LIMIT ='$entries' but it won't work. How do I do it. ??
Michael
Could you elaborate on the example? e.g.
$query = "SELECT colname FROM tablename LIMIT $entries";
I was trying to do this the other day, I found that this worked:
$query = "SELECT colname FROM tablename LIMIT 0, $limit";
Stupid stupid me... :o)))))))))
I had somehow erased a } in and earlier line, so it made an error in the mysql query line...
Sorry for the trouble, it works fine with LIMIT $entries