connect_er..."/> connect_er...">

Home  >  Article  >  Backend Development  >  Commonly used functions for php native operation database

Commonly used functions for php native operation database

爆肝混世大魔王-流笙 第五人格服务
爆肝混世大魔王-流笙 第五人格服务Original
2021-03-12 17:44:20173browse

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!

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