title: Put the values from database inside a '$string'
body: <pre><code>&lt;?php
  
  
  $dbHost = 'localhost'; // usually localhost
  $dbUsername = 'root';
  $dbPassword = '1234fedf';
  $dbDatabase = 'smsmobile';
  $db = mysql_connect($dbHost, $dbUsername, $dbPassword) or die ("Unable to connect to Database Server.");
  mysql_select_db ($dbDatabase, $db) or die ("Could not select database.");
  
  $sql = "SELECT destinationaddress FROM reporting";
  //print $sql;
  
  $queryRes1 = mysql_query($sql);
  
  while($rows=mysql_fetch_assoc($queryRes1))
  {
  $destinationaddress[] = $rows['destinationaddress']; 
  
  }
  
  
  
  $phones = $destinationaddress;
  
  
  $sqlprefix = "SELECT country,prefix FROM countrycodes";
  //print $sqlprefix;
  
  $queryprefix = mysql_query($sqlprefix);
  
  while($data=mysql_fetch_array($queryprefix))
  {
  $countryarray[] = $data['country']; 
  $prefixarry[] = $data['prefix']; 
  }
  $countryname = implode(',',$countryarray); 
  //print $countryname;
  $prfixname = implode(',',$prefixarry);
  //print $prfix;
  
  
  $countrycode = $countryname;
  $prfix = $prfixname;
  
  foreach($countryname as $key =&gt; $value){
  $result[] = 'country : '.$value.' prefix:'.$prfix[$key];
  }
  
  $allstring = implode(',',  $result);
  print_r( $allstring );
  
  
      ?&gt;
  </code></pre>