Jump to content

[help] gimana cara menyisipkan script delete aotomatis pada order]


mita

Recommended Posts

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 > $B) {

$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

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 by Zaid (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...