QUOTE(Christian J @ Jun 29 2010, 07:14 AM)
For
SQLite PHP offers
sqlite_array_query(), which returns an array --not a resource-- so you can apply FOR loops right away. Strange that such a function doesn't exist for MySQL.
Well, then write your own function. I don't quite understand the problem here: generally you get rows from mysql using a while loop, and if you want to count the row number, for example to add a heading every ten rows, then it's something like:
CODE
$row = 0;
while ($row = mysql_fetch_array(...))
{ if ($row%10 == 0)
<... show header line...>
... show stuff ...
$row++;
}
The thing that did seem to be missing from mysql is "Get rows 11-20 of query", which is what you need for output paging. But you can just write your own function to do what you need. (This is the difference between programming, where things get easier as you go along, and point-and-grunt manual stuff, like using Whirred or CSS, where they get more and more tangled up.)