[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/include/db/ -> db.inc.php (sommaire)

(pas de description)

Poids: 182 lignes (6 kb)
Inclus ou requis: 2 fois
Référencé: 1 fois
Nécessite: 0 fichiers

Définit 5 fonctions

  serendipity_db_update()
  serendipity_db_insert()
  serendipity_db_bool()
  serendipity_db_get_interval()
  serendipity_db_implode()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

serendipity_db_update($table, $keys, $values, $action = 'execute')   X-Ref
Perform a query to update the data of a certain table row

You can pass the tablename and an array of keys to select the row,
and an array of values to UPDATE in the DB table.

param: string   Name of the DB table
param: array    Input array that controls the "WHERE" condition part. Pass it an associative array like array('key1' => 'value1', 'key2' => 'value2') to get a statement like "WHERE key1 = value1 AND key2 = value2". Escaping is done automatically in this function.
param: array    Input array that controls the "SET" condition part. Pass it an associative array like array('key1' => 'value1', 'key2' => 'value2') to get a statement like "SET key1 = value1, key2 = value2". Escaping is done automatically in this function.
param: string   What do do with the SQL query (execute, display)
return: array    Returns the result of the SQL query

serendipity_db_insert($table, $values, $action = 'execute')   X-Ref
Perform a query to insert an associative array into a specific SQL table

You can pass a tablename and an array of input data to insert into an array.

param: string      Name of the SQL table
param: array       Associative array of keys/values to insert into the table. Escaping is done automatically.
param: string   What do do with the SQL query (execute, display)
return: array    Returns the result of the SQL query

serendipity_db_bool($val)   X-Ref
Check whether an input value corresponds to a TRUE/FALSE option in the SQL database.

Because older DBs could not store TRUE/FALSE values to be restored into a PHP variable,
this function tries to detect what the return code of a SQL column is, and convert it
to a PHP native boolean.

Values that will be recognized as TRUE are 'true', 't' and '1'.

param: string   input value to compare
return: boolean  boolean conversion of the input value

serendipity_db_get_interval($val, $ival = 900)   X-Ref
Return a SQL statement for a time interval or timestamp, specific to certain SQL backends

param: string  Indicate whether to return a timestamp, or an Interval
param: int     The interval one might want to use, if Interval return was selected
return: string  SQL statement

serendipity_db_implode($string, &$array, $type = 'int')   X-Ref
Operates on an array to prepare it for SQL usage.

param: string Concatenation character
param: array  Input array
param: string How to convert (int: Only numbers, string: serendipity_db_escape_String)
return: string Imploded string



Généré le : Sat Nov 24 09:00:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics