downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SQLite3Result::columnName> <SQLite3Stmt::reset
Last updated: Fri, 24 Sep 2010

view this page in

The SQLite3Result class

Introduction

A class that handles result sets for the SQLite 3 extension.

Class synopsis

SQLite3Result {
/* Methods */
public string columnName ( int $column_number )
public int columnType ( int $column_number )
public array fetchArray ([ int $mode = SQLITE3_BOTH ] )
public bool finalize ( void )
public int numColumns ( void )
public bool reset ( void )
}

Table of Contents



add a note add a note User Contributed Notes
SQLite3Result
claudiu at virtuamagic dot com
08-Mar-2010 11:34
fetchArray() will return bool(false) in case of 0 rows.
jonscully at gmail dot com
30-Nov-2009 10:35
Since SQLite3Result::numRows is unavailable, use:

<?php
if ($res->numColumns() && $res->columnType(0) != SQLITE3_NULL) {
   
// have rows
} else {
   
// zero rows
}
?>

Because when there are zero rows:
* SQLite3Result::fetchArray will return '1'
* SQLite3Result::numColumns will return '1'
* Column type for column '0' will be SQLITE3_NULL

SQLite3Result::columnName> <SQLite3Stmt::reset
Last updated: Fri, 24 Sep 2010
 
 
show source | credits | sitemap | contact | advertising | mirror sites