I have this query : <?php
$conn = pg_pconnect(“host=localhost dbname=go user=go”);
if (!$conn) {
echo “An error occured.\n”;
exit;
}
$result = pg_query($conn, “SELECT phones.phone FROM phones”);
if (!$result) {
echo “An error occured.\n”;
exit;
}
while ($row = pg_fetch_row($result)) {
echo “$row[0],\n”;
}
?>
Im trying to send all the output from the query to this script for the numbers variable, each row must have a , at the end then a new line like my echo statement. Any help would be greatly appreciated. I tried a include statement but its not working.
$url = ‘https://www.callfire.com/cloud/1/sms/send’;
$params = array(
‘apikey’ => ‘xxxxx’,
‘message’ => ‘Tornado Warning for your Geo-Location’,
‘numbers’ => ‘include ‘q.php’;’
);
$http = curl_init($url);
curl_setopt($http, CURLOPT_POST, true);
$query = http_build_query($params);
curl_setopt($http, CURLOPT_POSTFIELDS, $query);
$header = array(‘Content-Type: application/x-www-form-urlencoded’);
curl_setopt($http, CURLOPT_HTTPHEADER, $header);
curl_setopt($http, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($http, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($http, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($http);
$error = curl_error($http);
if($error != null)
{
echo “Error: $error\n”;
throw new Exception($error);
}
echo “Alert Sent”;
?>
but I unintentionally left out the function keyword so change sendCallfireSMS to function sendCallfireSMS($number)