So I have tried pulling the message from a database and when I reload the page to go to the page, it gives me the 500 error, I know that it does echo the message from the database but when trying to get it to go to the link and send the message it gives me that error, Im not sure what to do now.
<?php
$mysqli = new mysqli('localhost', 'user', 'pass', 'db');
$message = $mysqli->query("SELECT message FROM messages WHERE id = 1")->fetch_object()->message;
echo $message;
$chatIds = array("chatid"] ); // AND SOME MORE
foreach($chatIds as $chatId) {
// Send Message To chat id
file_get_contents("https://example.org/link/sendMessage?chat_id=$chatId&text=".$message);
}
?>