mita Posted May 8, 2012 Share Posted May 8, 2012 agan2 tolong gimana cara nyisipin delete order automatis pada tab order,, misalkan pelanngan saya yang lwat dari batas pembayaran , trus yang hapus ni script. <?php if (!mysql_connect("localhost","root","")){ echo "error"; die(); } //$a=date('Y-m-d H:m:s');// $a=time(); mysql_select_db("anekasutra_db"); $result=mysql_query("SELECT * FROM ps_orders"); $i=0; while ($row=mysql_fetch_array($result)) { $e=strtotime($row['date_add']); $c=$row['id_order']; $b=$e+432000; if ($a > $ { $query = mysql_query ("DELETE FROM `anekasutra_db`.`ps_orders` WHERE `ps_orders`.`id_order`='$c'"); echo "yes"; } else { echo "error"; } $i++; } ?> tolong ada yang bisa bantu..... Link to comment Share on other sites More sharing options...
Zaid Posted May 9, 2012 Share Posted May 9, 2012 kalau udah punya scriptnya tinggal running aja... biar script berjalan otomatis setiap hari, mungkin bisa dipanggil lewat cron job bro... Link to comment Share on other sites More sharing options...
prestanesia Posted May 9, 2012 Share Posted May 9, 2012 $query = mysql_query ("DELETE FROM `anekasutra_db`.`ps_orders` WHERE `ps_orders`.`id_order`='$c'"); heu, ngehapusnya hardcore. baeknya pake Order::deleteProduct() tapi sebelumnya query dulu bdsk tanggal. Link to comment Share on other sites More sharing options...
mita Posted May 13, 2012 Author Share Posted May 13, 2012 Mas said ini soalnya ,,masih localhost,, saya belum Online,, bisa minta cara ngejalani lwat localhost yah mas,,, Link to comment Share on other sites More sharing options...
Zaid Posted May 17, 2012 Share Posted May 17, 2012 (edited) buat file .php, taruh diroot. include-kan 2 file ini: config.inc.php dan init.php ( agar bisa menggunakan Classes PrestaShop) <?php include(dirname(__FILE__).'/config/config.inc.php'); include(dirname(__FILE__).'/init.php'); // Y O U R S C R I P T H E R E Betul kata Prestanesia, jangan langsung nyentuh DB, main coding aman saja... Pelajari class core di PrestaShop, disana banyak fungsi-fungsi penting yang sudah tersedia. Edited May 17, 2012 by Zaid (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now