Hi: I am trying to show database (on phpmyadmin) data using MySqli. I have created a database handler using the following code:
<?php
$dbServername = “locahost“;
$dbUsername = ”root”;
$dbPassword = “ ”;
$dbName = “march4”;
$conn = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
I have created an php that references the database handler (above) to select data from the table ‘books’ in a database called ‘march4’ (in my phpadmin). However I am getting a Parse error T_STRING on line #14 in the following code:
<?php
include _once (‘dbh.php’);
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$sql = “SELECT * FROM books”; // line 14
$result = mysqli_query($conn, $sql);
$resultcheck = mysqli_num_rows($result);
if ($resultcheck > 0) {
while ($row = mysqli_fetch_assoc($result)) {
echo $row[‘Author’];
}
}
?>
</body>
</html>
Please help!