What Do You Need to Connect PHP to MySQL

Q

What Do You Need to Connect PHP to MySQL? - PHP Script Tips - Working with MySQL Database

✍: FYIcenter.com

A

If you want to access MySQL database server in your PHP script, you need to make sure that MySQL module is installed and turned on in your PHP engine. Check the PHP configuration file, php.ini, to make sure the extension=php_mysql.dll is not commented out.

The MySQL module offers a number of functions to allow you to work with MySQL server. Some commonly used MySQL functions are:

  • mysql_connect -- Open a connection to a MySQL Server
  • mysql_close -- Close MySQL connection
  • mysql_db_query -- Send a MySQL query
  • mysql_fetch_array -- Fetch a result row as an associative array, a numeric array, or both
  • mysql_free_result -- Free result memory
  • mysql_list_tables -- List tables in a MySQL database
  • mysql_list_fields -- List MySQL table fields

2007-04-18, 4740👍, 0💬