2
People in the part of echo <p class="play">$row[/"email/"] </p>
gives 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 to it, without it I cannot 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();
?>
almost you do not miss, put the counter bars on
$row[\"email\"]
instead of putting in theclass="play"
. a solutionecho "<p class=\"play\"> $row["email"]</p>";
– user60252