I am learning mysql using an example.
According to the guidelines, I created a table and I was trying to access it with the following code:
<?php
define("MYSQLUSER", "php24sql");
define("MYSQLPASS", "");
define("HOSTNAME", "localhost");
define("MYSQLDB", "smithside");
$connection = @new mysqli(HOSTNAME, MYSQLUSER, MYSQLPASS, MYSQLDB);
if ($connection->connect_error) {
die('Connect Error: ' . $connection->connect_error);
}
else {
echo 'Successful connection to MySQL <br />';
if ($result = $connection->query("SHOW TABLES")) {
$count =$result->num_rows;
echo "Tables: ($count)<br />";
while ($row = $result->fetch_array()) {
echo $row[0]. '<br />';
}
}
}
I got the following error:
At first, I was sure it's the password, so I changed to "no password" using phpMyAdmin, but I still get the above error.
Here is what I see at phMyAdmin: