I have prove the query to the mysql table as
UPDATE info SET date_retire = date_retire+ 00600000;
which set the data of retirement of emplyees.
When i display the date_retire field on php page it give the wrong result as 01-01-1970 for each record on employee.
How can i achieve the desired date from field.
please help in this regard.
Adil
Date Problem in PHP?
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Date Problem in PHP?
1. What type of value are you storing in the 'date_retire' field?
2. Are you updating ALL the fields in the database at once, or one at a time?
2. Are you updating ALL the fields in the database at once, or one at a time?
In the query you are not specifying a record to update. If you use 'UPDATE table SET field = value' it updates ALL records in the table. To update individual records you should useWhen i display the date_retire field on php page it give the wrong result as 01-01-1970 for each record on employee.
Code: Select all
<?php $q = "UPDATE table SET field = $new_value WHERE id = $specific_id";
// or something similar depending on your table structure
?>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering