MySQL can be used in many languages, including PERL, C, Cellular, JAVA and PHP. Among these languages, MySQL is the most widely used in PHP’s web development.
Most of our examples in this tutorial use the PHP language. If you want to know more about the application of MySQL in PHP, you can visit our PHP 中使用 Mysqli 介绍 .
PHP provides several ways to access and manipulate Mysql database records. The format of PHP MySQL function is as follows:
mysqli_function(value,value,...);
The function section of the above format describes the functions 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 PHP to call the mysql function:
Instance (MySQLi)
<?php$retval=mysqli_function(value,[value,...]);if(!$retval){die("相关错误信息");}//其他
MySQL 或 PHP 语句?>
Starting with the next chapter, we will learn more about MySQL functions.