mardi 4 août 2015

SQLite query not returning all result rows

I am trying to pull out a section of rows from a SQLite 3 database using the following code:

function getunsolved($user) {
    $sql = "SELECT challenge FROM completed WHERE status = 0 AND username = '$user';";
    $rez = $this->query($sql);
    $temp = $rez->fetchArray(SQLITE3_NUM);
    return $temp;
}

Unfortunately, the code is only returning 1 row, and should be returning 9 rows.

Running the above SQL code on the database, and substituting a valid username for $user returns the correct amount of rows, so I know the problem isn't the SQL code.

My table format is as follows: username (TEXT), challenges (TEXT), status (INTEGER) (in that order, if it matters)

Aucun commentaire:

Enregistrer un commentaire