[ Index ]
 

Code source de XOOPS 2.0.17.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/htdocs/class/database/ -> mysqldatabase.php (sommaire)

(pas de description)

Author: Kazumi Ono <onokazu@xoops.org>
Copyright: copyright (c) 2000-2003 XOOPS.org
Poids: 395 lignes (11 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 3 classes

XoopsMySQLDatabase:: (19 méthodes):
  connect()
  genId()
  fetchRow()
  fetchArray()
  fetchBoth()
  getInsertId()
  getRowsNum()
  getAffectedRows()
  close()
  freeRecordSet()
  error()
  errno()
  quoteString()
  queryF()
  query()
  queryFromFile()
  getFieldName()
  getFieldType()
  getFieldsNum()

XoopsMySQLDatabaseSafe:: (1 méthode):
  query()

XoopsMySQLDatabaseProxy:: (1 méthode):
  query()


Classe: XoopsMySQLDatabase  - X-Ref

connection to a mysql database

connect($selectdb = true)   X-Ref
connect to the database

param: bool $selectdb select the database now?
return: bool successful?

genId($sequence)   X-Ref
generate an ID for a new row

This is for compatibility only. Will always return 0, because MySQL supports
autoincrement for primary keys.

param: string $sequence name of the sequence from which to get the next ID
return: int always 0, because mysql has support for autoincrement

fetchRow($result)   X-Ref
Get a result row as an enumerated array

param: resource $result
return: array

fetchArray($result)   X-Ref
Fetch a result row as an associative array

return: array

fetchBoth($result)   X-Ref
Fetch a result row as an associative array

return: array

getInsertId()   X-Ref
Get the ID generated from the previous INSERT operation

return: int

getRowsNum($result)   X-Ref
Get number of rows in result

param: resource query result
return: int

getAffectedRows()   X-Ref
Get number of affected rows

return: int

close()   X-Ref
Close MySQL connection


freeRecordSet($result)   X-Ref
will free all memory associated with the result identifier result.

param: resource query result
return: bool TRUE on success or FALSE on failure.

error()   X-Ref
Returns the text of the error message from previous MySQL operation

return: bool Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred.

errno()   X-Ref
Returns the numerical value of the error message from previous MySQL operation

return: int Returns the error number from the last MySQL function, or 0 (zero) if no error occurred.

quoteString($str)   X-Ref
Returns escaped string text with single quotes around it to be safely stored in database

param: string $str unescaped string text
return: string escaped string text with single quotes around

queryF($sql, $limit=0, $start=0)   X-Ref
perform a query on the database

param: string $sql a valid MySQL query
param: int $limit number of records to return
param: int $start offset of first record to return
return: resource query result or FALSE if successful

query($sql, $limit=0, $start=0)   X-Ref
perform a query

This method is empty and does nothing! It should therefore only be
used if nothing is exactly what you want done! ;-)

param: string $sql a valid MySQL query
param: int $limit number of records to return
param: int $start offset of first record to return

queryFromFile($file)   X-Ref
perform queries from SQL dump file in a batch

param: string $file file path to an SQL dump file
return: bool FALSE if failed reading SQL file or TRUE if the file has been read and queries executed

getFieldName($result, $offset)   X-Ref
Get field name

param: resource $result query result
param: int numerical field index
return: string

getFieldType($result, $offset)   X-Ref
Get field type

param: resource $result query result
param: int $offset numerical field index
return: string

getFieldsNum($result)   X-Ref
Get number of fields in result

param: resource $result query result
return: int

Classe: XoopsMySQLDatabaseSafe  - X-Ref

Safe Connection to a MySQL database.

query($sql, $limit=0, $start=0)   X-Ref
perform a query on the database

param: string $sql a valid MySQL query
param: int $limit number of records to return
param: int $start offset of first record to return
return: resource query result or FALSE if successful

Classe: XoopsMySQLDatabaseProxy  - X-Ref

Read-Only connection to a MySQL database.

This class allows only SELECT queries to be performed through its
{@link query()} method for security reasons.


query($sql, $limit=0, $start=0)   X-Ref
perform a query on the database

this method allows only SELECT queries for safety.

param: string $sql a valid MySQL query
param: int $limit number of records to return
param: int $start offset of first record to return
return: resource query result or FALSE if unsuccessful



Généré le : Sun Nov 25 11:44:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics