MySQL PHP syntax
MySQL PHP syntax
MySQL can be used in multiple languages, including PERL, C, C++, JAVA and PHP. Among these languages, Mysql is the most widely used in PHP web development.
Most of our examples in this tutorial use PHP language. If you want to learn about the application of Mysql in PHP, you can visit our PHP tutorial
PHP provides a variety of ways to access and operate Mysql database records. The PHP Mysqli function format is as follows:
mysqli_function(value,value,...);
The function part in the above format describes the function of the mysql function, such as
mysqli_connect($connect); mysqli_query($connect,"SQL 语句"); mysqli_fetch_array()mysqli_close()
<?php
$retval = mysqli_function(value, [value,...]);
if( !$retval )
{
die ( "Related error information" );
}
// Other MySQL or PHP statements
?>
$retval = mysqli_function(value, [value,...]);
if( !$retval )
{
die ( "Related error information" );
}
// Other MySQL or PHP statements
?>
Starting from the next chapter, we will learn more MySQL functions.