PHP API Functions

Below is a list of PHP API functions. Click on a function in the list to see more information about it, including its syntax, an explanation of its use, and examples of how it may be used to interface with MySQL.

mysql_affected_rows( )

This PHP API function returns the number of rows in MySQL that were affected by a previous SQL statement that modified rows of data in a MySQL table for the current MySQL session.

mysql_client_encoding( )

This PHP API function returns the name of the default character set for the current MySQL connection or, if the connection identification number is supplied, for that particular MySQL connection.

mysql_db_name( )

This PHP API function returns the name of the database from the results of the mysql_list_dbs( ) PHP function, which returns a pointer to a MySQL results set containing the names of databases for a MySQL server.

mysql_db_query( )

This PHP API function can be used to query the MySQL database given, for the current MySQL connection (unless another is specified), and to execute the SQL statement given as the second argument.

mysql_fetch_array( )

This PHP API function returns an array containing a row of data from a MySQL query results set.

mysql_fetch_assoc( )

This PHP API function returns an associative array containing a row of data from a results set generated by a query executed in MySQL.

mysql_fetch_object( )

This PHP API function returns a row of data as an object from a given results set from MySQL.

mysql_field_flags( )

This PHP API function returns the field flags for a field of a given results set from MySQL.

mysql_field_len( )

This PHP API function returns the length from a field of a given MySQL results set.

mysql_field_name( )

This PHP API function returns the name of a field from a given MySQL results set.

mysql_field_table( )

This PHP API function returns the name of the MySQL table that contains a particular field from the MySQL results set given.

mysql_field_type( )

This PHP API function returns the MySQL column datatype for a field from the MySQL results set given.

mysql_pconnect( )

This PHP API function may be used to open a persistent connection to MySQL.

mysql_result( )

This PHP API function returns the data from one field of a row from the results of a MySQL query.

mysql_set_charset( )

This PHP API function sets the default character set for the current connection to MySQL, or for a MySQL connection given with the function.

mysql_tablename( )

This PHP funtion returns the table name for a particular MySQL table in the results set given by the PHP function, mysql_list_tables( ).

mysql_unbuffered_query( )

Use this PHP function to execute a MySQL statement given without buffering the results so that you can retrieve the data from MySQL without having to wait for the results set to be completed.