Hi
I have this code:
$cid1 is displaying the date correctly as 2005-03-28
$cid2 should be displaying the time. The time is being inserted in the database correctly yet it keeps displaying as 19:00 no matter what. Each record in the database is differant yet it keeps showing 19:00.
Anyone see something I am doing wrong? Maybe there is a better way to insert the time in the database.
Here is the code that I am using to insert time and date into the database.
Remember, I am very new to learning PHP/MYSQL!
Thanks!
I have this code:
PHP Code:
$cid1 = mysql_result($result, $i, "today");
$cid2 = mysql_result($result, $i, "time");
//Convert unix timestamp to date
$cid2 = date("H:i:s", $time);
$cid2 should be displaying the time. The time is being inserted in the database correctly yet it keeps displaying as 19:00 no matter what. Each record in the database is differant yet it keeps showing 19:00.
Anyone see something I am doing wrong? Maybe there is a better way to insert the time in the database.
Here is the code that I am using to insert time and date into the database.
PHP Code:
$newcomment = $_POST['newcomment'];
$member = $_POST['mid'];
$ip = $_SERVER['REMOTE_ADDR'];
$now = time();
$today = date("Y-m-d");
sqlquery("INSERT INTO $comments_table VALUES('', '$newcomment', '$member', '$username', '$ip','$now','$today')");
Thanks!
Comment