Cheat sheets can increase productivity in programming. How?In a cheat sheet, you can write down different functions [with parameters and syntax] that you use frequently [or all the important functions of a programming language]. Whenever, you are confused, take a quick look at the cheat sheets. Sometimes it can be faster than searching the internet. You can categorize the functions based on the purpose, within a category - sort them alphabetically for easier search/scan. You can create, many cheat sheets for a particular language. Keep them beside you while you are writing codes. A sample cheat sheet regarding PHP functions to handle MySQL database is provided below. Note, the cheat sheet needs to be improved such as: categorize the functions [like for connection management, retrieving data, keep track of database/operation status, collecting information about the database [meta-data]], sort the functions alphabetically. Keep the font size small to list more functions in a small space
resource mysql_unbuffered_query ( string $query [, resource $link_identifier ] ) |
Send an SQL query to MySQL, without fetching and buffering the result rows |
int mysql_thread_id ([ resource $link_identifier ] ) |
Return the current thread ID |
bool mysql_ping ([ resource $link_identifier ] ) |
Ping a server connection or reconnect if there is no connection |
resource mysql_list_processes ([ resource $link_identifier ] ) |
List MySQL processes |
string mysql_tablename ( resource $result , int $i ) |
the table name from a result |
string mysql_stat ([ resource $link_identifier ] ) |
Get current system status |
bool mysql_set_charset ( string $charset [, resource $link_identifier ] ) |
Sets the default character set for the current connection. |
bool mysql_select_db ( string $database_name [, resource $link_identifier ] ) |
Select a MySQL database |
string mysql_result ( resource $result , int $row [, mixed $field ] ) |
Retrieves the contents of one cell from a MySQL result set. |
string mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier ] ) |
Escapes special characters in the unescaped_string , taking into account the current character set of the connection so that it is safe to place it in a mysql_query(). If binary data is to be inserted, this function must be used |
resource mysql_query ( string $query [, resource $link_identifier ] ) |
sends a unique query (multiple queries are not supported) to the currently active database |
resource mysql_pconnect ([ string $server [, string $username [, string $password [, int $client_flags ]]]] ) |
Establishes a persistent connection to a MySQL server. |
int mysql_num_rows ( resource $result ) |
Retrieves the number of rows from a result set |
int mysql_affected_rows ([ resource $link_identifier ] ) |
Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE |
int mysql_num_fields ( resource $result ) |
Retrieves the number of fields from a query. |
resource mysql_list_tables ( string $database [, resource $link_identifier ] ) |
Retrieves a list of table names from a MySQL database. |
resource mysql_list_fields ( string $database_name , string $table_name [, resource $link_identifier ] ) |
Retrieves information about the given table name. |
use mysql_query() to issue a SQL SHOW COLUMNS FROM table |
resource mysql_list_dbs ([ resource $link_identifier ] ) |
List databases available on a MySQL server |
int mysql_insert_id ([ resource $link_identifier ] ) |
Get the ID generated from the previous INSERT operation |
string mysql_info ([ resource $link_identifier ] ) |
Get information about the most recent query |
string mysql_get_server_info ([ resource $link_identifier ] ) |
Retrieves the MySQL server version. |
int mysql_get_proto_info ([ resource $link_identifier ] ) |
Retrieves the MySQL protocol. |
string mysql_get_host_info ([ resource $link_identifier ] ) |
Describes the type of connection in use for the connection, including the server host name. |
string mysql_get_client_info ( void ) |
returns a string that represents the client library version. |
bool mysql_free_result ( resource $result ) |
free all memory associated with the result identifier result . |
string mysql_field_type ( resource $result , int $field_offset ) |
Get the type of the specified field in a result |
string mysql_field_table ( resource $result , int $field_offset ) |
Get name of the table the specified field is in |
bool mysql_field_seek ( resource $result , int $field_offset ) |
Set result pointer to a specified field offset |
string mysql_field_name ( resource $result , int $field_offset ) |
Get the name of the specified field in a result |
int mysql_field_len ( resource $result , int $field_offset ) |
returns the length of the specified field. |
string mysql_field_flags ( resource $result , int $field_offset ) |
Get the flags associated with the specified field in a result |
array mysql_fetch_row ( resource $result ) |
Get a result row as an enumerated array |
object mysql_fetch_object ( resource $result [, string $class_name [, array $params ]] ) |
Fetch a result row as an object |
array mysql_fetch_lengths ( resource $result ) |
Get the length of each output in a result |
object mysql_fetch_field ( resource $result [, int $field_offset ] ) |
Get column information from a result and return as an object |
array mysql_fetch_assoc ( resource $result ) |
Fetch a result row as an associative array |
array mysql_fetch_array ( resource $result [, int $result_type ] ) |
Fetch a result row as an associative array, a numeric array, or both |
string mysql_escape_string ( string $unescaped_string ) |
Escapes a string for use in a mysql_query |
string mysql_error ([ resource $link_identifier ] ) |
Returns the text of the error message from previous MySQL operation |
int mysql_errno ([ resource $link_identifier ] ) |
Returns the numerical value of the error message from previous MySQL operation |
bool mysql_drop_db ( string $database_name [, resource $link_identifier ] ) |
Drop (delete) a MySQL database |
resource mysql_db_query ( string $database , string $query [, resource $link_identifier ] ) |
selects a database, and executes a query on it. |
string mysql_db_name ( resource $result , int $row [, mixed $field ] ) |
|
bool mysql_data_seek ( resource $result , int $row_number ) |
Move internal result pointer |
bool mysql_create_db ( string $database_name [, resource $link_identifier ] |
Create a MySQL database |
resource mysql_connect ([ string $server [, string $username [, string $password [, bool $new_link [, int $client_flags ]]]]] ) |
Open a connection to a MySQL Server |
bool mysql_close ([ resource $link_identifier ] ) |
Close MySQL connection |
string mysql_client_encoding ([ resource $link_identifier ] ) |
Returns the name of the character set |
int mysql_change_user ( string $user , string $password [, string $database [, resource $link_identifier ]] ) |
Change logged in user of the active connection |
int mysql_affected_rows ([ resource $link_identifier ] ) |
Get number of affected rows in previous MySQL operation |