i have a database table with fields mobno1 and mobno2, first i would like store all the values of field mobno1 into var1 and field mobno2 into var2 by using comma seperator and pdo. my code is as follows.
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT mobno1,mobno2 FROM custreg";
$q = $pdo->prepare($sql);
$q->execute();
$data = $q->fetch(PDO::FETCH_ASSOC);
$mobile_number1=$data['mobno1'];
$mobile_number2=$data['mobno2'];
Database::disconnect();
$message = urlencode($tempmsg);
// Prepare data for POST request
$data = "user=".$cpuser."&password=".$cppass."&mobiles=".$mobile_number1.",".$mobile_number2."&sms=".$message."&senderid=".$cpsender;
// Send the POST request with cURL
$ch = curl_init('http://msg.sendsms.com/sendsms.jsp'); //note https for SSL
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch); //This is the result from Textlocal
curl_close($ch);
Database::disconnect();
i hope someone will resolve this issue, thanks in advance.