Home > Database > Mysql Tutorial > body text

MySQL PHP syntax

巴扎黑
Release: 2016-11-29 09:05:42
Original
1236 people have browsed it

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>
Copy after login


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!