English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

MySQL PHP Syntax

MySQL can be applied to various languages, including PERL, C, and C++.++MySQL is widely used in PHP web development among these languages, such as JAVA and PHP.

In this tutorial, most of our examples use PHP language. If you want to learn about the application of MySQL in PHP, you can visit our Introduction to Mysqli in PHP.

PHP provides various ways to access and operate MySQL database records. The format of PHP mysqli functions is as follows:

mysqli_function(value, value,...);

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

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

The following example demonstrates the syntax of PHP calling mysql functions:

<?php
$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 about MySQL feature functions.