Introduction to PHP’s Built-In MYSQL Functions
The MySQL database has grown to be the world’s hottest open-source database due to its constant quick efficiency, excessive reliability, and ease of use. It is utilized in greater than 6 million installations starting from massive firms to specialised embedded functions on each continent on the earth. PHP offers to assist MySQL with an array of features that can be utilized to govern MySQL knowledge. The aim of this tutorial is to introduce these features generally utilized in PHP data-driven functions for retrieving, updating, inserting, and deleting knowledge.
- 1mysqli_connect (MySQL server name,username,password) – opens a connection to a MySQL server.
- 2mysqli_query (sql query) – sends a query to the currently active database.
- 3mysqli_insert_id (connection id) – returns the auto increment value from the last query
- 4mysqli_fetch_array (recordset id) – Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.
- 5mysqli_num_rows (recordset id) – determines the number of rows contained in a recordset returned by the previous SQL SELECT operation. The function returns a value of FALSE if the operation fails.
- 6mysqli_affected_rows (connection id) – determines the number of rows affected by the previous SQL INSERT, DELETE, or UPDATE operation. The function returns a value of -1 if the operation fails.
- 7mysqli_close() Closes a previously opened database connection
- 8mysqli_errno() Returns the last error code for the most recent function call
- 9mysqli_error() Returns the last error description for the most recent function call
- 10mysqli_fetch_assoc() Fetches a result row as an associative array
- 11mysqli_fetch_row() Fetches one row from a result-set and returns it as an enumerated array
- 12mysqli_select_db() Changes the default database for the connection

