...

time format

0810
10-10-2002, 08:54 PM
Hi how are you doing? I would like to format time for my guestbook. but I get error

I did like this



$sql="select name,location,url,comments,date_format(msgtime, \"%Y/%m/%d %H:%i:%s\") as mtime from guestbook order by msgtime desc";

and
and take out time from my database
echo $row["msgtime"];



I got an error.

Notice: Undefined index: msgtime in c:\ito\guestbookview.php on line 23


Could you tell me the right command to format date?

Thanks all

mordred
10-10-2002, 09:51 PM
The SQL query looks okay, it's maybe just that you retrieve the formated value "as mtime", so you have to access this value by using "mtime" as the index, like:


echo $row["mtime"];



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum