title: Send Push Notification on All token in database MySql
body: <p>I've create a push notification for my app, it work perfect but not sending the notification on all devices token.</p>
  
  <p>first I have a database name "member" and it contains id, username, password, token</p>
  
  <p>then I create this php function to send notification</p>
  
  <pre><code>&lt;?php
  // API access key from Google API's Console
  define( 'API_ACCESS_KEY', 'XXXXXXXXXXXXXXXXX' );
  include 'DatabaseConfig.php';
  
   $con = mysqli_connect($HostName,$HostUser,$HostPass,$DatabaseName);
  $checktoken = "SELECT token FROM member";
  $results = $con-&gt;query($checktoken);
  
  if ($results -&gt;num_rows &gt; 0) {
  
  while($row = $results-&gt;fetch_assoc()){
  
  $regid = array($row["token"]);
  echo "" .$row["token"]. " ";
  }
  }else{
  echo "No result";
  }
  
  // prep the bundle
  $msg = array
  (
      'body'  =&gt; 'here is a message. message',
      'title'     =&gt; 'This is a title. title',
      'subtitle'  =&gt; 'This is a subtitle. subtitle',
      'tickerText'    =&gt; 'Ticker text here...Ticker text here...Ticker text here',
      'vibrate'   =&gt; 1,
      'sound'     =&gt; 'mySound',
      'largeIcon' =&gt; 'large_icon',
      'smallIcon' =&gt; 'small_icon'
  );
  $fields = array
  (
      'registration_ids'  =&gt; $regid,
      'notification'          =&gt; $msg
  );
  
  $headers = array
  (
      'Authorization: key=' . API_ACCESS_KEY,
      'Content-Type: application/json'
  );
  
  $ch = curl_init();
  curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
  curl_setopt( $ch,CURLOPT_POST, true );
  curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
  curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
  curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
  curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
  $result = curl_exec($ch );
  curl_close( $ch );
  echo $result;
  </code></pre>
  
  <p>the code only send to one device only, and when I tried to access it in browser it show </p>
  
  <blockquote>
    <p>eY0-0uIUDsA:APA91bGmFatL_gtizFRbC9mMbagzsMalJuJ6e_O2poytaKgBTVIsyl5ogJ4-x7PlQebyu6z7ME970H9hdlZUEiLESTNPrSvcn_1PzmKh3AJiwIUZj86_fRxPt9yOpL4k3PZb7Ir6xf43
    dPEPzRFjnIo:APA91bHBaHO8nZK2g4xF6vzvKrevNhpBRSdIb3NyWrr2PRCEyDR9cLkCZOZ28_hu5pDzdaSKkRxPY1mvYO8ZOnjEscjdKGCEv-FIdIBzrz32mof0rQSlog028kDhv7jltGjWwK7r7l-J
    {"multicast_id":9198379759567809790,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1513945312938936%cd487dfdcd487dfd"}]}</p>
  </blockquote>
  
  <p>it has 2 devices there, but why it only send to one device token? any fix for my code?</p>
  
  <p>for your information
  first device start with eY0-0uIUDsA:
  second one start with dPEPzRFjnIo:</p>