I want to show me from the database ID and User (from table users), this is my code but i keep getint an errors.
<?php
$conn = new mysqli('127.0.0.1','S024_V7','S024_V7','S024_V7');
$sql ="SELECT id, user FROM Users";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<br> ID: ". $row["id"]. " - Name: ". $row["User"]."<br>";
}
} else {
echo "0 results";
}
$conn->close();
?>
Errors: Parse error: syntax error, unexpected '""' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in /Projekti/S024_V7/index.php on line 9
Notice: Trying to get property of non-object in /Projekti/S024_V7/index.php on line 7 0 results