Cara input data otomatis per tanggal semua id dengan PHP dan MysqlDibuat
Login Terakhir
7 Bulan lalu,
Telah Dilihat 3603 Kali
| |
Sultan Account |
|
|
Teguh budiyono
Mengatakan :
Sultan Account
asalamualakim warohmatulohi wabarokatu gan mau tanya cara input data otomatis per tanggal 25 semua id seperti di gamabra gimana ya gan ? terimakasih Ada 1 File Kiriman : 1. tanya1.PNG (10 KB) |
|
| PHPMU.COM Support commented on 23 Nov 2016 12:24:58 Sultan Account |
|
|
|
Pake bantuan ajax saja dengan kondisi,..
simpan dengan nama file cek.php :
if (date('d')=='25' and date('H:i')=='01:00'){
$query = mysql_query("SELECT * FROM nasabah");
while ($row = mysql_fetch_array($query)){
mysql_query("INSERT INTO tbl_kredit ('','$row[id_nasabah]','500')");
}
}
function ajaxrunning(){
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}else{
xmlhttp =new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
}
}
xmlhttp.open("GET","cek.php");
xmlhttp.send();
setTimeout("ajaxrunning()", 5000);
} |
|