He Olaf,
Can you explain what you mean with this code? It's from db_cart_class.php on line 130
function remove_old_orders($customer, $remove_only_zeros = true) {
if (RECOVER_ORDER && $customer > 0) {
$sql = sprintf("DELETE FROM %s WHERE open = 'y' AND customer = %d AND order_date < (NOW() - %d)", ORDERS, $customer, VALID_UNTIL * 86400);
} else {
$sql = sprintf("DELETE FROM %s WHERE open = 'y' AND order_date < (NOW() - %d)", ORDERS, VALID_UNTIL * 86400);
}
$sql .= ($remove_only_zeros) ? " AND customer = 0" : "";
mysql_query($sql);
}
My question really is: how can i put $sql .= ($remove_only_zeros) ? " AND customer = 0" : ""; behind the other queries? I know it's one query, because the sql .= will make it one. But i want something like this (i know this isn't right)
function remove_old_orders($customer, $remove_only_zeros = true) {
if (RECOVER_ORDER && $customer > 0) {
$sql = sprintf("DELETE FROM %s WHERE open = 'y' AND customer = %d AND order_date < (NOW() - %d)", ORDERS, $customer, VALID_UNTIL * 86400), ($remove_only_zeros) ? " AND customer = 0" : ";
} else {
$sql = sprintf("DELETE FROM %s WHERE open = 'y' AND order_date < (NOW() - %d)", ORDERS, VALID_UNTIL * 86400), ($remove_only_zeros) ? " AND customer = 0" : ";
}
mysql_query($sql);
}
Is this possible?
I hope you understand what i mean
Thanx