Function
//Fungsi untuk mengecek table agar tidak ada DULPIKASI datafunction cek_tabel(){
global $namafile;
$query = mysql_query("select FTDATE,FTEXT,FTDNUM,FTTIME,FTDUR from trans_a order by FTDATE DESC limit 0 ,1") or die ("Query gagal: ".mysql_error());
$hasil=mysql_fetch_array($query);
$query2 = mysql_query("select * from trans where FTDATE= '$hasil[FTDATE]' and FTEXT='$hasil[FTEXT]' and FTDNUM='$hasil[FTDNUM]' and FTTIME='$hasil[FTTIME]'") or die ("Query gagal: ".mysql_error());
$hasil2=mysql_fetch_array($query2);
if ($hasil2[FTDUR] == $hasil[FTDUR]){
echo"Data yang dimasukkan sudah Ada
";
}
else {
simpan($namafile);
$hapus = mysql_query("delete from trans_a");
echo"
Data Baru Telah Tersimpan";
}
}
0 Komentar:
Post a Comment
<< Home