I've encoutered strange problem when using sqlite_seek(). When I tried to move the pointer to the first row (#0) I got the fallowing error message: row 0 out of range. The workaround seems to be use of sqlite_rewind(). One can use the fallowing function instead of the original one:
<?php
function sqlite_data_seek($result, $numrow) {
if ($numrow==0) {
return sql_rewind($result);
} else {
return sql_seek($result, $numrow);
}
}
?>
sqlite_seek
SQLiteResult::seek
(PHP 5 < 5.4.0, PECL sqlite >= 1.0.0)
sqlite_seek -- SQLiteResult::seek — Posizionamento su una data riga di un set di risultati bufferizzato
Descrizione
bool sqlite_seek
( resource
$result
, int $rownum
)Stile orientato agli oggetti (metodo):
bool SQLiteResult::seek
( int
$rownum
)
sqlite_seek() si posiziona sulla riga indicata dal parametro
rownum.
Elenco dei parametri
-
result -
Risorsa risultato di SQLite. Questo parametro non รจ richiesto nella versione ad oggetti.
Nota:
This function cannot be used with unbuffered result handles.
-
rownum -
Il numero ordinale di riga da cercare. I numeri di riga partono da zero ( 0 indica la prima riga).
Nota:
This function cannot be used with unbuffered result handles.
Valori restituiti
La funzione restituisce FALSE se la riga richiesta non esiste, oppure TRUE.
Vedere anche:
- sqlite_next() - Si sposta al successivo numero di riga
- sqlite_current() - Scarica la riga corrente di un set di risultati in un array
- sqlite_rewind() - Si posiziona sulla prima riga
mina86 at tlen dot pl ¶
9 years ago
