3 Replies - 460 Views - Last Post: 03 April 2013 - 08:47 AM Rate Topic: -----

#1 eeveemaria20  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-April 13

How to set expiration date in php?

Posted 03 April 2013 - 08:35 AM

Hi. I need to get back by items if the orders made by the user are not paid within a day. :( please help what will i use in php..
Is This A Good Question/Topic? 0
  • +

Replies To: How to set expiration date in php?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9426
  • View blog
  • Posts: 35,422
  • Joined: 12-June 08

Re: How to set expiration date in php?

Posted 03 April 2013 - 08:42 AM

A simple report that queries all the orders and would do a 'date difference' from the order insert date to the paid date.. .. if greater than 1 day then return in the collection.
Was This Post Helpful? 0
  • +
  • -

#3 eeveemaria20  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-April 13

Re: How to set expiration date in php?

Posted 03 April 2013 - 08:44 AM

View Postmodi123_1, on 03 April 2013 - 08:42 AM, said:

A simple report that queries all the orders and would do a 'date difference' from the order insert date to the paid date.. .. if greater than 1 day then return in the collection.


:( do i need to store it using sessions in php? If it's ok can you give me a simple code of how it will run? :(
$newamount = $availablequantity - $quantity;
if($enddate > $startdate) {
if($availablequantity != 0) {	
		
$sql = mysql_query("UPDATE size SET quantity ='$newamount' WHERE id ='$item_id'") or die (mysql_error());

}
 //$sql = mysql_query("UPDATE size SET quantity = WHERE size ='$item_id'") or die (mysql_error());		
	
		} 
else if($startdate < $enddate) {
	
	$sql = mysql_query("UPDATE size SET quantity ='$availablequantity' WHERE id ='$item_id'") or die (mysql_error());
	}



how am i gong to do it?

This post has been edited by Atli: 03 April 2013 - 08:50 AM
Reason for edit:: Use [code] tags when posting code.

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9426
  • View blog
  • Posts: 35,422
  • Joined: 12-June 08

Re: How to set expiration date in php?

Posted 03 April 2013 - 08:47 AM

Store what? If you are taking in an order your best be storing a 'date entered' that is the current date time that row was inserted.. I would also figure you would have a 'date entered' for when a payment was made.. you know.. to be the current date time that payment was inserted.

What you are asking for is just a report. Take data you already have, do some basic math, throw it in a condition and see what comes out.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1