connect_er..."> Commonly used functions for php native operation database-PHP Tutorial-php.cn

Commonly used functions for php native operation database

爆肝混世大魔王-流笙 第五人格服务
Release: 2021-03-15 09:01:27
Original
97 people have browsed it

mysqli_query( $conn, "set names 'utf8'" ); //Set the character encoding

mysqli_close( $conn ); //Close the connection

$conn = new mysqli( 'localhost', 'Library name', 'Library password' );//Create a connection

if ( $conn->connect_error ) {

die( "Connection failed: " . $ conn->connect_error );

}//Detect connection

$result = mysqli_query( $conn, $sql );

$row = mysqli_fetch_assoc( $result ) ;//Check for phrases

The above is the detailed content of Commonly used functions for php native operation database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
1
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
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!