How can the PHP script be modified to include all forum topics in the newsletter email?

The PHP script needs to be modified to query all forum topics from the database and include them in the newsletter email. This can be achieved by updating the SQL query to fetch all topics and then looping through the results to add them to the email content.

// Get all forum topics from the database
$query = "SELECT topic_title, topic_content FROM forum_topics";
$result = mysqli_query($conn, $query);

// Loop through the results and add each topic to the email content
$email_content = "Latest forum topics:\n";
while($row = mysqli_fetch_assoc($result)) {
    $email_content .= "Topic: " . $row['topic_title'] . "\n";
    $email_content .= "Content: " . $row['topic_content'] . "\n\n";
}

// Include the forum topics in the newsletter email
$to = "recipient@example.com";
$subject = "Latest Forum Topics";
$headers = "From: sender@example.com";
mail($to, $subject, $email_content, $headers);