Breaking News
Home / Web / PHP / PHP FAQ / What are the most common Mysql Commands used in PHP?

What are the most common Mysql Commands used in PHP?

Answer

PHP provides very simple commands to connect, fetch or execute query against MYSQL database. The following are as common commands.

   * mysql_connect(). Opens a connection to the MYSQL server. The input to this command is the database     hostname, username, and password.

   * mysql_select_db(). Selects a database on the MYSQL server. The input to this command is the database name.

   * mysql_query(). Issues the SQL statement. The input to this command is the sql statement to execute.

   * mysql_fetch_array(). Converts an SQL statement result row in an array.The input to this command is the sql result returned by mysql_query method.

   * mysql_result(). Gets single element result data from a successful query.

   * mysql_error(). Returns a string representation of the error message as returned from MySQL.
<!>

[pb_builder]

Check Also

What is the structure of a PHP Program?

Program Organization is key to readability, ease of debugging, few bugs, simplicity and more. As …

Leave a Reply