Selasa, 20 Oktober 2015

Php : How To Use Mysqli Num Rows In Php

Php Code To Get Number Of Rows In Mysqli Result Using Mysql Database


________________________________________________________


In this Php Tutorial we will see How To Use mysqli_num_rows To Get Number Of Rows From Mysqli Result Using MySQL Database Table In With Php .

I Use In This Tutorial:
- NetBeans IDE .
- XAMPP .
- PhpMyAdmin .


 




Php Source Code:

<?php

// PHP Using mysqli_num_rows Function
// get number of data in mysqli result

$host = "localhost";

$user = "root";

$pass = "";

$database = "test_db";

$connect = mysqli_connect($host, $user, $pass, $database);

$query = "SELECT * FROM users";

$result = mysqli_query($connect, $query);

$numRow = mysqli_num_rows($result);

echo "<h1>".$numRow."</h1>";


///////////////OUTPUT:  16



                     

Bagikan

Jangan lewatkan

Php : How To Use Mysqli Num Rows In Php
4/ 5
Oleh

Subscribe via email

Suka dengan artikel di atas? Tambahkan email Anda untuk berlangganan.