Brand new to PHP and I'm going through a few tutorials at the moment. I have created a login.php file that has my hostname, database, username, and password. My test1.php page requires this login.php file and then attempts to connect to it.
I then select a database, attempt a query, and store the results. Here is what I have so far:
<?php // test1.php
require_once 'login.php';
$db_server = mysqli_connect($db_hostname, $db_username, $db_password);
if (!$db_server) die("Unable to connect to MySQL: " . mysql_error());
mysqli_select_db($db_server, $db_database)
or die("Unable to select database: " . mysql_error());
$query = "SELECT * FROM classics";
$result = mysqli_query($db_server, $query);
if (!$result) die ("Database access failed: " . mysql_error());
$rows = mysql_num_rows($result);
?>
The error that I am getting says:
mysql_num_rows() expects parameter 1 to be resource, object given on line 15
Line 15 is:
$rows = mysql_num_rows($result);
What exactly is the resource that I am looking to pass into mysql_num_rows()?