带有cron作业服务的PHP MYSQL select语句。仅选择新记录

时间:2016-06-14 14:02:40

标签: php mysql cron

我需要从数据库中选择记录而不再重复它们。我正在使用cron。我需要cron服务在第一次运行后只选择新记录。那么,有人会引导我通过吗?谢谢。

//should select the fresh or new data after the first run
$sql = "SELECT name, amount, trans_id, msisdn, time_paid FROM customer";
$result1 = mysqli_query($conn, $sql);
$resultarr = mysqli_fetch_assoc($result1); // fetch data

$name = $resultarr['name'];
$amount = $resultarr['amount'];
$transaction_id = $resultarr['trans_id'];
$date = $resultarr['time_paid'];

//message template
$message = "Dear $name we have received $amount from you. MPESA transaction Id $transaction_id on $date.";

$mobilenumber = $resultarr['msisdn']; // get mobile number from array
$message_sent = $message;

$serviceArguments = array(
    "mobilenumber" => $mobilenumber,
    "message" => $message_sent
);

$client = new SoapClient("http://32.138.160.130:8080

0 个答案:

没有答案