Fetch in the echo <p class="play">$row[/"email/"] </p>
part of a syntax error
Parse error: syntax error, unexpected 'play' (T_STRING), expecting ',' or in C: \ xampp \ htdocs \ a \ index.php on line 20
Does not recognize the class I give it, without it I can not format the results.
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT email FROM news";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<p class="play"> $row[\"email\"]</p>";
}
} else {
echo "0 results";
}
$conn->close();
?>