Categorys & Date functions

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
nabberuk
Forum Newbie
Posts: 6
Joined: Fri Oct 25, 2002 7:41 am

Categorys & Date functions

Post by nabberuk »

Right, a couple of things i'd like a little advice on.

Firstly, I'm doing a subscription based login system. When the user signs up, they get 365 days credit. Was is the best method of removing 1 credit off everyday on 100's of users. The data is stored in a mysql db.

Secondly, I'll be having a directory/categorys (like how ebay has). Whats the best way to about this?

Many thanks.


Nathan
Last edited by nabberuk on Mon Sep 03, 2007 11:21 am, edited 1 time in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: a little advice

Post by volka »

nabberuk wrote: When the user signs up, they get 365 days credit. Was is the best method of removing 1 credit off everyday on 100's of users.
You yould store the expiration date instead of the amount of credits.
nabberuk
Forum Newbie
Posts: 6
Joined: Fri Oct 25, 2002 7:41 am

Re: a little advice

Post by nabberuk »

volka wrote:
nabberuk wrote: When the user signs up, they get 365 days credit. Was is the best method of removing 1 credit off everyday on 100's of users.
You yould store the expiration date instead of the amount of credits.
Would i be able to work out how many days are left?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

Datediff()
nabberuk
Forum Newbie
Posts: 6
Joined: Fri Oct 25, 2002 7:41 am

Post by nabberuk »

califdon wrote:Datediff()
when using the datediff function i get the following;

Code: Select all

Fatal error: Call to undefined function datediff() in C:\xampp\htdocs\datetest.php on line 5
Is datediff available in PHP Version 5.2.3?

EDIT: is datediff a mysql or php function? agh, im confused.

Many thanks.
josa
Forum Commoner
Posts: 75
Joined: Mon Jun 24, 2002 4:58 am
Location: Sweden

Post by josa »

Post Reply