|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Date
Hi
I was wondering if anyone would know of a solution to the following: I have a web site form linked to my database using PHP. I now need to check a date entered by the user with whatever the current date is to check that the event didn't take place more than three years ago. My problem is that I don't know how to write or access a calender so the system is aware of the current date. Furthermore, I assume I'd have to have such a calender stored in my database so I could compare the two dates? Please help, I've no idea what is needed to get around this problem. Vicki |
|
#2
|
|||
|
|||
|
RE: Date
To get the current date just use the date() function. The result can be formated in differnet ways. I wouldn't assume that the date is stored in the db if you haven't storded any. Can you show me the table-structure? |
|
#3
|
|||
|
|||
|
RE: Date
The table structure is:
$sql = "INSERT INTO test (title,given_name,surname,occupation,income,ni_no, house_name,house_number,street,city,post_code,numb er,acc_day,acc_month,acc_year) However, I want to check the date of the accident (acc_day, acc_month, acc_year) against the current date. I only want to submit the information into my table if the date of the accident was within 3 years from the current date. I hope this makes sence to you. Vicki |
|
#4
|
|||
|
|||
|
RE: Date
|
|
#5
|
|||
|
|||
|
RE: Date
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|