Thanks for the info about changing to ‘class’ instead of ‘id’. Yes, it’s for CSS.
It’s always been working with id, so I never really gave it a thought.
There is no Error when I try to search. But instead of the search result coming up for the search, it just displays the whole result set like it does without searching.
Since it worked before I used pagination, something must have happened after that. I don’t know what though.
I wonder if it’s something in the SELECT, that isn’t right? I’m going to show you what the select looked like earlier and what I have right now. Since I added pagination I had to add things to the select and change it a bit.
I’ve always wondered what WHERE 1=1 means. Is that ‘TRUE’. Or what does it do?
This is what SELECT looked like before. This one is together with getting the search result. The variables are later used in getting the result set.
$select = 'SELECT DISTINCT id, joketext';
$from = ' FROM joke';
$where = ' WHERE 1=1';
This is the SELECT where you get the resultset on the same page.
$result = @mysql_query($select . $from . $where);
This is what I have now. I tried to add WHERE 1=1, but that didn’t work. Does it matter where you place the WHERE clause? Or do you even need it?
I place it after FROM, but that didn’t work.
Let me know what you think.
Thanks!
Bjorn
$query_count = "SELECT DISTINCT id, jokedate, joketitle, joketext FROM joke WHERE 1=1 ORDER BY joketitle LIMIT $limitvalue, $limit";