[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

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

(pas de description)

Poids: 369 lignes (13 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 16 fonctions

  serendipity_db_begin_transaction()
  serendipity_db_end_transaction()
  serendipity_db_in_sql()
  serendipity_db_query()
  serendipity_db_insert_id()
  serendipity_db_affected_rows()
  serendipity_db_updated_rows()
  serendipity_db_matched_rows()
  serendipity_db_escape_string()
  serendipity_db_limit()
  serendipity_db_limit_sql()
  serendipity_db_connect()
  serendipity_db_reconnect()
  serendipity_db_schema_import()
  serendipity_db_probe()
  serendipity_db_concat()

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

serendipity_db_begin_transaction()   X-Ref
Tells the DB Layer to start a DB transaction.


serendipity_db_end_transaction($commit)   X-Ref
Tells the DB Layer to end a DB transaction.

param: boolean  If true, perform the query. If false, rollback.

serendipity_db_in_sql($col, &$search_ids, $type = ' OR ')   X-Ref
Assemble and return SQL condition for a "IN (...)" clause

param: string   table column name
param: array    referenced array of values to search for in the "IN (...)" clause
param: string   condition of how to associate the different input values of the $search_ids parameter
return: string   resulting SQL string

serendipity_db_query($sql, $single = false, $result_type = "both", $reportErr = false, $assocKey = false, $assocVal = false, $expectError = false)   X-Ref
Perform a DB Layer SQL query.

This function returns values dependin on the input parameters and the result of the query.
It can return:
false if there was an error,
true if the query succeeded but did not generate any rows
array of field values if it returned a single row and $single is true
array of array of field values if it returned row(s) [stacked array]

param: string      SQL query to execute
param: boolean     Toggle whether the expected result is a single row (TRUE) or multiple rows (FALSE). This affects whether the returned array is 1 or 2 dimensional!
param: string      Result type of the array indexing. Can be one of "assoc" (associative), "num" (numerical), "both" (numerical and associative, default)
param: boolean     If true, errors will be reported. If false, errors will be ignored.
param: string      A possible array key name, so that you can control the multi-dimensional mapping of an array by the key column
param: string      A possible array field name, so that you can control the multi-dimensional mapping of an array by the key column and the field value.
param: boolean     If true, the executed SQL error is known to fail, and should be disregarded (errors can be ignroed on DUPLICATE INDEX queries and the likes)
return: mixed       Returns the result of the SQL query, depending on the input parameters

serendipity_db_insert_id()   X-Ref
Returns the latest INSERT_ID of an SQL INSERT INTO command, for auto-increment columns

return: int      Value of the auto-increment column

serendipity_db_affected_rows()   X-Ref
Returns the number of affected rows of a SQL query

return: int      Number of affected rows

serendipity_db_updated_rows()   X-Ref
Returns the number of updated rows in a SQL query

return: int  Number of updated rows

serendipity_db_matched_rows()   X-Ref
Returns the number of matched rows in a SQL query

return: int  Number of matched rows

serendipity_db_escape_string($string)   X-Ref
Returns a escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.

param: string   input string
return: string   output string

serendipity_db_limit($start, $offset)   X-Ref
Returns the option to a LIMIT SQL statement, because it varies accross DB systems

param: int      Number of the first row to return data from
param: int      Number of rows to return
return: string   SQL string to pass to a LIMIT statement

serendipity_db_limit_sql($limitstring)   X-Ref
Return a LIMIT SQL option to the DB Layer as a full LIMIT statement

param: SQL string of a LIMIT option
return: SQL string containing a full LIMIT statement

serendipity_db_connect()   X-Ref
Connect to the configured Database

return: ressource   connection handle

serendipity_db_reconnect()   X-Ref
Pas de description

serendipity_db_schema_import($query)   X-Ref
Prepares a Serendipty query input to fully valid SQL. Replaces certain "template" variables.

param: string   SQL query with template variables to convert
return: ressource    SQL ressource handle of the executed query

serendipity_db_probe($hash, &$errs)   X-Ref
Try to connect to the configured Database (during installation)

param: array     input configuration array, holding the connection info
param: array     referenced array which holds the errors that might be encountered
return: boolean   return true on success, false on error

serendipity_db_concat($string)   X-Ref
Returns the SQL code used for concatenating strings

param: string   Input string/column to concatenate
return: string   SQL parameter



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