Home > Backend Development > PHP Tutorial > PHP5 connects mysql data class_PHP tutorial

PHP5 connects mysql data class_PHP tutorial

WBOY
Release: 2016-07-13 17:40:18
Original
1071 people have browsed it

@ $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...
    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