我有以下php脚本查询mysql数据库以发送消息。我想在数据库表的每1000行循环中发送“message”变量。下面是代码,这有什么问题?
public delegate void onMessageReady(string message);
public event onMessageReady MessageReady;
答案 0 :(得分:1)
检查这个
<?php
$num = $con->query("SELECT gcm_regid from gcm_users")->rowCount();
$current_num = 0;
$message = $_POST["message"];
for ($i = 0; $i < $num / 999; $i++) {
$query = $con->query("SELECT gcm_regid from gcm_users LIMIT $current_num, 999");
$row = array()
while($result = $query->fetch_assoc()){
$row[] = $result['gcm_regid']
}
$pushStatus = send_notification($con, $row, $message);
$current_num += 999;
}
?>