compare date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

compare date

Post by hrubos »

Who would mind suggesting for me .
Now I don't know how the way to do that :

Everymonths we have to pay a house_bill, and if over the new month u have to will a housle bill and plus more 50usd.So what to solve it

Thank you !!!
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

You need to use better English than that so we know exactly what you're getting at. Also, if you could post your own attempt at what you are trying to achieve we will give you some pointers.
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

So I need the solution to make system understand that : when person still paid house_bill for a old month and now it's new month, so his bill now which he has to pay, have been plus 5 usd.

So how is condition with function date() .

Example that : I have a table
(today : 09/01/2007)
Name | Amount | Date |
Kevin | 500 | 2007-01-09 | pay

so if he don't paid the bill to 01/02/2007 , I will output that table :
Name | Amount | Date |
Kevin | 550 | 2007-01-09 | pay
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

You will probably need to use a cron job to automatically check the dates in the table every day and if any of the dates are one month earlier than todays date add 50 to the amount column associated with that date.
Post Reply