Jump to content

Recommended Posts

In my users table in my mysql database I have the field "created", in the format of CURRENT_TIMESTAMP (which upon inserting a new record uses NOW() as a default) resulting in a format of 2006-03-21 12:48:14.
I use this as when a member registers it automatically places the date and time within.

Now what I need is to create a php page with all the members information, including the number of days they have been a member.

I've tried to place the created date into a variable and used NOW(), DATE(), TIME(), CURDATE(), CURTIME() etc to get the current date (subtracting one from the other) but it doesnt seem to work when trying to subtract the two dates.

Also I need the result displayed in number of days.


Anyone know how I can proceed to achieve this?
Link to comment
https://forums.phpfreaks.com/topic/5618-number-of-days/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.