PM ME
more info through pms?
more info through pms?
here quick pleaseHit me up in Discord.
<?php
$query = mysql_query("SELECT * FROM table");
$numberOfRows = mysql_num_rows($query);
echo "The number of rows is: " . $numberOfRows;
?>
<?php
$connection = mysqli_connect("localhost","username","password","db_name");
$query = mysqli_query($connection, "SELECT * FROM table");
$numberOfRows = mysqli_num_rows($query);
echo "The number of rows is: " . $numberOfRows;
?>
The original MySQL API (mysql) was deprecated in PHP 5.5 and removed in PHP 7.0. Current stable PHP is 7.3.Pebbbles
Depends on whether you're using MySQL or MySQLi (I suggest MySQLi). Here's options for both.
For MySQL:
PHP:<?php $query = mysql_query("SELECT * FROM table"); $numberOfRows = mysql_num_rows($query); echo "The number of rows is: " . $numberOfRows; ?>
For MySQLi:
PHP:<?php $connection = mysqli_connect("localhost","username","password","db_name"); $query = mysqli_query($connection, "SELECT * FROM table"); $numberOfRows = mysqli_num_rows($query); echo "The number of rows is: " . $numberOfRows; ?>
