How does PHP use a MySQL database? PHP MySQL function example

How to use a MySQL database with PHP ? PHP MySQL function examples.

MySQL PHP syntax

MySQL is available in many languages, including PERL, C, C++, JAVA and PHP.Among these languages, Mysql is the most widely used in PHP web development.

In this MySQL database tutorial, most of our examples use the PHP language.

PHP provides several ways to access and manipulate MySQL database records. The PHP MySQLi function format is as follows:

mysqli_function(value,value,...);

The function part of the above format describes the function of the mysql function, such as

mysqli_connect($connect);
mysqli_query($connect,"SQL 语句");
mysqli_fetch_array()
mysqli_close()

The following example shows the syntax for calling mysql functions in PHP:

Instance (MySQLi)

<?
php
$retval = mysqli_function(value, [value,...]);
if( !$retval )
{
 die ( "相关错误信息" );
}
// 其他 MySQL 或 PHP 语句
?> 

From the next chapter, we will learn more MySQL functions.

Comment

Your email address will not be published. Required fields are marked with * .

Scroll to Top