mysql_field_flags
Returns the flags
associated with the
specified field in a
result
mysql_insert_id (^) Returns the ID
generated from the
previous INSERT
operation
mysql_data_seek
Moves the internal
result pointer
mysql_free_result (^) Frees result memory
Error Handling
mysql_errno (^) Returns the error
message number from
the previous MySQL
operation
mysql_error (^) Returns the error
message text from the
previous MySQL
operation
Other Information
About the Database
mysql_list_dbs
Returns a list of
databases available on
the MySQL server
mysql_list_tables (^) Returns a list of tables
in a MySQL database
mysql_field_len
Returns the length of
the specified field
mysql_field_table
Gets the name of the
table containing the
specified field
mysql_tablename (^) Returns the table name
of field
Connecting to the MySQL Database Server
You use mysql_connect to connect to the specified database server. The following is the full syntax for
mysql_connect:
mysql_connect ([hostname[:port][:/path/to/socket]], username, password);
This function returns a positive integer when successful, denoting the link identifier, or zero for failure.
To connect to a MySQL database, you might do the following:
$link_id = mysql_connect ("localhost", $dbuser, $userpass);
echo "Link ID is ".$link_id;
Provided your variables are correctly set, this statement produces the following:
Link ID is 1
Success! The returned link identifier of 1 indicates that you have connected to your database on the
Web server (localhost) using the database name given by $database, the username given by
$dbuser, and password given by $userpass.