utyDbSqlite Class Reference
[Database sqlite API]

Sqlite Data Access abstraction. More...

Inheritance diagram for utyDbSqlite:
utyDb

List of all members.

Public Member Functions

 open ($server, $dbname, $username, $password, $options=NULL)
 close ()
 escape ($text)
 query ($sql, &$result)
 exec ($sql)
 fetch ($result)
 insertID ()
 queryCount ($result)
 execCount ()

Detailed Description

Sqlite Data Access abstraction.


Member Function Documentation

close (  ) 

Close the connection (if opened)

Implements utyDb.

escape ( text  ) 
Returns:
Sqlite escaped sql value

Implements utyDb.

exec ( sql  ) 

Exec the sql statement (INSERT,UPDATE,DELETE, etc) to the connected database.

Parameters:
sql (string) the sql statement
Returns:
NULL if OK, utyResult if ERROR

NOTABENE: use escape for data values

See also:
use execCount() to retrieve the number of rows affected

Implements utyDb.

execCount (  ) 
Returns:
the number of rows affected by the last executed sql statement (INSERT,UPDATE,DELETE, etc)

Implements utyDb.

fetch ( result  ) 

Fetches the result of a query.

Returns:
the next row in the result or FALSE if at the end.
See also:
use queryCount() to retrieve the number of rows selected

Implements utyDb.

insertID (  ) 
Returns:
the ID of the last executed INSERT when the table has an INTEGER PRIMARY KEY field

Implements utyDb.

open ( server,
dbname,
username,
password,
options = NULL 
)

Opens the connection to the database.

Parameters:
server (string) IGNORED
dbname (string) the fullname (including path) of the sqlite file
username (string) IGNORED
password (string) IGNORED
[options] (array) IGNORED, default=NULL
Returns:
NULL if OK, utyResult if ERROR

NOTABENE:

  • use the @ silent operator to avoid unwanted sensitive data logging
  • sqlite will consider only the dbname parameter anyway

Implements utyDb.

query ( sql,
&$  result 
)

Query the sql SELECT statement to the connected database.

Parameters:
sql (string) the sql SELECT statement
$result (resource) pointer to an empty resource (any declared variable). Will be set to the sqlite query output.
Returns:
NULL if OK, utyResult if ERROR

NOTABENE: use escape for data values

See also:
use queryCount() to retrieve the number of rows selected

Implements utyDb.

queryCount ( result  ) 
Returns:
the number of rows in result

Implements utyDb.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations

Copyright © 2010 Attilio Pavone - www.utillyty.eu