tce_db_dal_mysqli.php

tce_db_dal_mysqli.php source file reference

Package: com\tecnick\tcexam\shared

Tags

  • file: MySQL driver for TCExam Database Abstraction Layer (DAL). This abstraction layer uses the same SQL syntax of MySQL.
  • author: Nicola Asuni
  • since: 2003-10-12

Functions

F_db_connect()

File: tce_db_dal_mysqli.php line 45

F_db_connect([mixed $host = 'localhost' ][, mixed $port = '3306' ][, mixed $username = 'root' ][, mixed $password = '' ][, mixed $database = '' ]) : MySQL

Parameters

  • $host : mixed = ’localhost’: (string) database server host name.
  • $port : mixed = ‘3306’: (string) database connection port
  • $username : mixed = ‘root’: (string) Name of the user that owns the server process.
  • $password : mixed = ‘’: (string) Password of the user that owns the server process.
  • $database : mixed = ‘’: (string) Database name.

Return values

MySQL —

link identifier on success, or FALSE on failure.

F_db_close()

File: tce_db_dal_mysqli.php line 68

F_db_close(mixed $link_identifier) : bool

Parameters

  • $link_identifier : mixed: (resource) database link identifier.

Return values

bool —

TRUE on success or FALSE on failure

F_db_error()

File: tce_db_dal_mysqli.php line 77

F_db_error([mixed $link_identifier = null ]) : string

Parameters

  • $link_identifier : mixed = null

Return values

string —

error message.

F_db_query()

File: tce_db_dal_mysqli.php line 92

F_db_query(mixed $query, mixed $link_identifier) : false

Parameters

  • $query : mixed: (string) The query tosend. The query string should not end with a semicolon.
  • $link_identifier : mixed: (resource) database link identifier.

Return values

false —

in case of error, TRUE or resource-identifier in case of success.

F_db_fetch_array()

File: tce_db_dal_mysqli.php line 105

F_db_fetch_array(mixed $result) : Returns

Note: This function sets NULL fields to PHP NULL value.

Parameters

  • $result : mixed: (resource) result resource to the query result.

Return values

Returns —

an array that corresponds to the fetched row, or FALSE if there are no more rows.

F_db_fetch_assoc()

File: tce_db_dal_mysqli.php line 116

F_db_fetch_assoc(mixed $result) : Returns

Note: This function sets NULL fields to PHP NULL value.

Parameters

  • $result : mixed: (resource) result resource to the query result.

Return values

Returns —

an array that corresponds to the fetched row, or FALSE if there are no more rows.

F_db_affected_rows()

File: tce_db_dal_mysqli.php line 127

F_db_affected_rows(mixed $link_identifier, mixed $result) : Number

Parameters

  • $link_identifier : mixed: (resource) database link identifier.
  • $result : mixed: (resource) result resource to the query result [UNUSED].

Return values

Number —

of rows.

F_db_num_rows()

File: tce_db_dal_mysqli.php line 137

F_db_num_rows(mixed $result) : Number

Parameters

  • $result : mixed: (resource) result resource to the query result.

Return values

Number —

of affected rows.

F_db_insert_id()

File: tce_db_dal_mysqli.php line 149

F_db_insert_id(mixed $link_identifier[, mixed $tablename = '' ][, mixed $fieldname = '' ]) : int

Parameters

  • $link_identifier : mixed: (resource) database link identifier.
  • $tablename : mixed = ‘’: (string) Table name. (unused here but required for other DAL).
  • $fieldname : mixed = ‘’: (string) Field name (column name). (unused here but required for other DAL).

Return values

int —

ID generated from the last INSERT operation.

F_db_datetime_diff_seconds()

File: tce_db_dal_mysqli.php line 158

F_db_datetime_diff_seconds(mixed $start_date_field, mixed $end_date_field) : SQL

Parameters

  • $start_date_field : mixed
  • $end_date_field : mixed

Return values

SQL —

query string

F_escape_sql()

File: tce_db_dal_mysqli.php line 171

F_escape_sql(mixed $link_identifier, mixed $str[, mixed $stripslashes = true ]) : string

Parameters

  • $link_identifier : mixed: (resource) database link identifier.
  • $str : mixed: (string) The string that is to be escaped.
  • $stripslashes : mixed = true: (boolean) if true strip slashes from string

Tags

  • since: 5.0.005 2007-12-05

Return values

string —

Returns the escaped string, or FALSE on error.