Personal tools
From wiki.swiftlytilting.com
Jump to: navigation, search

WinBinder Manual/Database functions

These are PHP-based database wrapper functions designed to interact smoothly with WinBinder objects. They are not part of the core and may be used independently of WinBinder if desired. Database functions start with the prefix db_. See <winterpostwiki>Database support</winterpostwiki> for more information.


NOTE: These functions are available for SQLite and MySQL only.

Contents

Database functions

<winterpostwiki>db_close_database</winterpostwiki> Closes the currently open database
<winterpostwiki>db_get_info</winterpostwiki> Returns database and wrapper version information
<winterpostwiki>db_list_database_tables</winterpostwiki> Lists the tables that exist in the current database
<winterpostwiki>db_open_database</winterpostwiki> Opens a database

Table functions

<winterpostwiki>db_create_table</winterpostwiki> Creates a table in the current database
<winterpostwiki>db_delete_table</winterpostwiki> Deletes a table
<winterpostwiki>db_list_table_fields</winterpostwiki> Returns all field names or field attributes from a table
<winterpostwiki>db_rename_table</winterpostwiki> Renames a table
<winterpostwiki>db_table_exists</winterpostwiki> Checks for the existence of a table in the current database

Field functions

<winterpostwiki>db_create_field</winterpostwiki> Creates a field in a table
<winterpostwiki>db_delete_field</winterpostwiki> Deletes a field in a table
<winterpostwiki>db_edit_field</winterpostwiki> Edits a field attribute in a table
<winterpostwiki>db_rename_field</winterpostwiki> Renames a field in a table

Record functions

<winterpostwiki>db_create_record</winterpostwiki> Creates a record in a table
<winterpostwiki>db_delete_records</winterpostwiki> Deletes records in a table
<winterpostwiki>db_edit_record</winterpostwiki> Edits a record in a table
<winterpostwiki>db_get_data</winterpostwiki> Reads data from a table
<winterpostwiki>db_get_id</winterpostwiki> Gets the identifier of an indexed record in a table
<winterpostwiki>db_get_next_free_id</winterpostwiki> Gets the next available id in a table
<winterpostwiki>db_swap_records</winterpostwiki> Swaps two records in a table

SQL functions

NOTE: See <winterpostwiki>Database support</winterpostwiki> for more information on SQL functions.

<winterpostwiki>db_fetch_array</winterpostwiki> Retrieves an array from a resource
<winterpostwiki>db_free_result</winterpostwiki> Frees memory allocated by a SQL query
<winterpostwiki>db_escape_string</winterpostwiki> Escapes a string for use in a SQL query
<winterpostwiki>db_query</winterpostwiki> Queries the current database using SQL

See also

Winbinder Projects