I have the following code
<?php
$servername = "localhost";
$username = "user";
$password = "pass";
$dbname = "database";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT id, name, time, order FROM main";
$result = mysqli_query($conn, $sql);
$num = mysqli_num_rows($result);
echo "Stuff: " . $num;
mysqli_close($conn);
?>
For some reason, this does not return a value when uploaded to my server and run on my web browser. Can anyone understand why this might be?
Many thanks