UnionOfRAD/lithium — Issue #253: SQLite everyother row
Author: tonyeung
Created: 2012-01-09 00:00:25+00:00
State: open

I have a users table which I get all rows (there are 4 total) by calling

```php
$users = Users::all();
```
my index page displays my results

```php

username; ?>

```
of which only 2 show, with ids 1 and 3 showing

a call to $users->count(); returns 2 results

querying the $sql variable shows: SELECT * FROM "users" AS "Users";

If I delete the row with id 1, ids 2 and 4 will show.

My conclusion is that for some reason, only every other row will get returned to the record set.
I created a quick php page to query the sqlite table and there are 4 rows to begin with, and my deletion of row with id 1 will only delete that one row. My php page:

```phpexec("CREATE TABLE users(id integer PRIMARY KEY, username text UNIQUE NOT NULL, password text, usertype integer)");
//$db->exec("ALTER TABLE users ADD COLUMN usertype");

//now output the data to a simple html table...
print "

";
print "
id	username	password	usertype
";
$result = $db->query('SELECT * FROM "users" AS "Users"');
foreach($result as $row)
{
print "
".$row['id']."";
print "	".$row['username']."";
print "	".$row['password']."";
print "	".$row['usertype']."
";
}
print "

";

// close the database connection
$db = NULL;
}
catch(PDOException $e) {
print 'Exception : '.$e->getMessage();
}

?>
```

I got pulled down lithium from git on the 2nd, what am I doing wrong?