Home > Backend Development > PHP Problem > There are several pieces of data in the php statistics database

There are several pieces of data in the php statistics database

(*-*)浩
Release: 2023-02-24 09:14:02
Original
4660 people have browsed it

The materials that need to be prepared are: computer, php editor, and browser.

There are several pieces of data in the php statistics database

1. First, open the php editor and create a new php file, for example: index.php. (Recommended learning: PHP programming from entry to proficiency)

There are several pieces of data in the php statistics database

2. In index.php, enter the code:

$conn = new mysqli('10.5.15.177', 'root', '', 'test');
$sql = "select * from stu";
$r = $conn->query($sql);
print_r($r->num_rows);
Copy after login

There are several pieces of data in the php statistics database

3. The browser runs the index.php page, and the number of records in the stu table is printed out as 5.

There are several pieces of data in the php statistics database

The above is the detailed content of There are several pieces of data in the php statistics database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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