MySQL PHP syntax

MySQL can be used in many languages, including PERL, C, C++, JAVA and PHP. Among these languages, Mysql is the most widely used in PHP web development.

In this tutorial, most of our examples use the PHP language. If you want to understand the application of Mysql in PHP, you can visit our introduction to using Mysqli in PHP.

PHP provides a variety of ways to access and manipulate Mysql database records. PHP Mysqli function format is as follows:

mysqli_function(< span class="pln">value,value,...); span>

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

mysqli_connect($connect); mysqli_query($connect,"SQL statement"); mysqli_fetch_array() mysqli_close() span>

The following example shows PHP The syntax for calling mysql function:

example (MySQLi)

$retval = mysqli_function( value, [value,…]); if( !$retval ) { die< span class="hl-code"> ( Related error information ); } // other MySQL or PHP statements ?> span> span>

Example (MySQLi)

$retval = mysqli_function(value, [value,…]); if< span class="hl-brackets">( !$retval ) { die ( related error information ); }< span class="hl-code"> // other MySQL or PHP statements ?> span>

$retval = < span class="hl-identifier">mysqli_function< span class="hl-brackets">(value, [value,…]) ; if( !$retval ) { die ( Related error information ); } // Other MySQL or PHP statements ?>< /span>< /span>

$retval = mysqli_function( value, [value,…]); if( !$retval ) { die< span class="hl-code"> ( Related error information ); < span class="hl-brackets">} // other MySQL or PHP statements ?>< /span>< /span>

Leave a Comment

Your email address will not be published.