PHP Code Date and Time Help?

cmiller

New member
I want to have a PHP Script that shows the date and time something was last updated without manually adding that in. If so can someone post a sample PHP Script to show me how to do it
I would like to do it with in the PHP page and not have to deal with MySQL, but if I have to I want a step-by-step guide on how to do it!
PLEASE AND THANK YOU
 
well there are a few question I would have for you:
Do you use a database?
Do you use a flat file system?

The answer will very based on your response.

//Database
$query = mysql_query("SELECT date FROM database WHERE something='$something'");
// Error checking right here!
$result = mysql_result($query,0);
echo $result;

To update that date

$query = mysql_query("UPDATE database SET date='" . addslashes($_POST['updatedate']) . "' WHERE date='$whateveryouwanttoupdate'");

and use the above to pull the result
 
Back
Top