Home || Syllabus || Assignments || Readings || Resources

Notes on PHP for Class discussion -- This material will *NOT* be on the final exam!!

PHP functions for use with MySQL:

PHP function Mysql task
mysql_connect (server-name, user-name, password) attempts to open a connection to a mysql server
mysql_create_db (database-name,link-identifier) attempts to create a new database on the server associated with the specified link-identifier
mysql_select_db (database-name,link-identifier) sets the current active database
mysql_drop_db (database-name,link-identifier) attempts to delete an entire database
mysql_fetch_array (result) returns an array that corresponds to a table row
mysql_list_dbs (link-identifier) lists the databases available on a mysql server
mysql_num_rows (result) returns the number of table rows in a result
mysql_list_tables (database-name, link-identifier) lists the tables in the specified database
mysql_query (SQL-query-string, link-identifier) submits a query to the currently active database

Sample PHP programs for class discussion:

Send email to with any questions!