Interesting point -- "blame MySQL" <G>
Your explanation would seem to work, which is why the two changes of increasing the limit to "max_num_categories" and eliminating the loop worked. We built all the categories, up to the "max_num_categories" and travelled through the 'loop' exactly once.
One thing I didn't think of is to look at the MySQL version.
There are/have been tweaks of MySQL and how it handles these conditions through the versions. That would explain why it works for some people, but not others, in a fashion independent of the actual code -- it's the _database_ causing problems, not the code <groan>
So... everyone... cough it up. What versions of MySQL are you running?????
Now... one thing. The logic bug.
We want $offset to be =1 the _first_ time through? If so, then $offset=1, get rid of the '$offset+1' in the query. Leave the increment $offset++;
What I don't understand, is why it worked, with the offset being screwy, or, if I fix this, will categories suddenly appear? It looks like it was skipping a page, since $offset was being incremented 2x in the first loop.
==> incremented to 2
==> set to 3 in the second query
==> incremented to 3
==> set to 4 in the third query...
... second page '$offset=2' never executed.
http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/
Your explanation would seem to work, which is why the two changes of increasing the limit to "max_num_categories" and eliminating the loop worked. We built all the categories, up to the "max_num_categories" and travelled through the 'loop' exactly once.
One thing I didn't think of is to look at the MySQL version.
There are/have been tweaks of MySQL and how it handles these conditions through the versions. That would explain why it works for some people, but not others, in a fashion independent of the actual code -- it's the _database_ causing problems, not the code <groan>
So... everyone... cough it up. What versions of MySQL are you running?????
Now... one thing. The logic bug.
We want $offset to be =1 the _first_ time through? If so, then $offset=1, get rid of the '$offset+1' in the query. Leave the increment $offset++;
What I don't understand, is why it worked, with the offset being screwy, or, if I fix this, will categories suddenly appear? It looks like it was skipping a page, since $offset was being incremented 2x in the first loop.
Code:
$offset=0 ==> set to '1' in the first 'query' ==> incremented to 2
==> set to 3 in the second query
==> incremented to 3
==> set to 4 in the third query...
... second page '$offset=2' never executed.
http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/