I am working on this script main function is to take a numbers from database with commas and use it inside curl to send a sms with api.
if(isset($_POST['getnumber']))
{
$matchid2 = $_POST['matchid2'];
//connect db
require_once __DIR__ . '/../db_connect.php';
$db = new DB_CONNECT();
$con = $db->connect();
$results = $con->query("SELECT DISTINCT ur.mobile FROM matchmst mst INNER JOIN matchdetail dtl on mst.matchid=dtl.matchid INNER JOIN user ur on ur.userid=dtl.userid WHERE mst.matchid = '$matchid2'");
// look through query
$datas = array();
while($row = $results->fetch_assoc()){
$datas[] = $row;
}
foreach ($datas as $data) {
$mobiles = $data['mobile'].",";
}
}
When i tried to echo this in html i am only getting one value from array i.e. 84*******4, and blank but i want to print complete row of that nubers in html
<div class="form-group">
<?php echo '<label for="msg">'.$mobiles.'</label>'; ?>
</div>
So how can i solve this pelase help. Thanks in advance.