Home >Database >Mysql Tutorial >MySQL PHP syntax

MySQL PHP syntax

巴扎黑
巴扎黑Original
2016-11-29 09:05:421316browse

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.

PHP provides multiple ways to access and operate Mysql database records.

PHP Mysql function format is as follows:

mysql_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 statement");

mysql_fetch_array()

mysql_connect()

mysql_close()

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

<html>
<head>
<meta charset="utf-8"> 
<title>PHP MySQL</title>
</head>
<body>
<?php
   $retval = mysql_function(value, [value,...]);
   if( !$retval )
   {
       die ( "相关错误信息" );
   }
   // 其他 MySQL 或 PHP 语句
?>
</body>
</html>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn