3.4. SQL and Database Infrastructure

3.4.1. dbi_conn_connect

int dbi_conn_connect(dbi_conn Conn)

Connects to the database using the options (host, username, password, port, (etc.) set with dbi_set_option() and dbi_set_option_numeric(). See the documentation for each specific database driver for the options it recognizes and requires.

3.4.2. dbi_conn_get_db_list

dbi_result dbi_conn_get_db_list(dbi_conn Conn, const char *pattern)

Queries the list of available databases on the server.

3.4.3. dbi_conn_get_table_list

dbi_result dbi_conn_get_table_list(dbi_conn Conn, const char *db, const char *pattern)

Queries the list of available tables in a particular database.

3.4.4. dbi_conn_query

dbi_result dbi_conn_query(dbi_conn Conn, const char *formatstr, ...)

Execute the specified SQL query statement.

3.4.5. dbi_conn_query_null

dbi_result dbi_conn_query_null(dbi_conn Conn, const unsigned char *statement, unsigned long st_length)

Execute the specified SQL query statement, which may contain valid NULL characters.

3.4.6. dbi_conn_select_db

int dbi_conn_select_db(dbi_conn Conn, const char *db)

Switches to a different database on the server.

3.4.7. dbi_result_get_conn

dbi_conn dbi_result_get_conn(dbi_result Result)

Returns the connection belonging to the specified result object.

3.4.8. dbi_result_free

int dbi_result_free(dbi_result Result)

Frees the result's query, disables all stored field bindings, and releases internally stored variables.

3.4.9. dbi_result_seek_row

int dbi_result_seek_row(dbi_result Result, unsigned int row)

Jump to a specific row in a result set.

3.4.10. dbi_result_first_row

int dbi_result_first_row(dbi_result Result)

Jump to the first row in a result set.

3.4.11. dbi_result_last_row

int dbi_result_last_row(dbi_result Result)

Jump to the last row in a result set.

3.4.12. dbi_result_prev_row

int dbi_result_prev_row(dbi_result Result)

Jump to the previous row in a result set.

3.4.13. dbi_result_next_row

int dbi_result_next_row(dbi_result Result)

Jump to the next row in a result set.

3.4.14. dbi_result_get_numrows

unsigned int dbi_result_get_numrows(dbi_result Result)

Returns the number of rows in the specified result set.

3.4.15. dbi_result_get_numrows_affected

unsigned int dbi_result_get_numrows_affected(dbi_result Result)

Returns the number of rows in the specified result set that were actually modified. Note that not all database servers support this, in which case it will always be zero. See the documentation for each specific driver for details.