Home  >  Article  >  Backend Development  >  PHP5 connects mysql data class_PHP tutorial

PHP5 connects mysql data class_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:40:181060browse

@ $db = new mysqli_connect(host, username, password, database name); //Connect to the database

$sql = "";

$result = $db->query($sql); //Execute sql statement

$num_results = $result->unm_rows; //Return the number of rows

$row = $result->fetch_row($result); //Fetch a row of data or use

$row = $result->object(); //Return a row of data into an object. For example $row->title
  • Source: Programming Home
  • www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486232.htmlTechArticle@ $db = new mysqli_connect(host, username, password, database name); //Connect to database $sql = ""; $result = $db-query($sql); //Execute sql statement $num_results = $result-unm_rows; //Return rows...
    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