All righty. Thanks A LOT for that code. I have got it working 😃
I'd give you a hug, but you know.. 😉
There is yet another question I want to ask (which is related to it).
Ok, this is what I use to convery TimeStamp to a readable form of date
<?php
///////////////////////////////////
// DB Connect
///////////////////////////////////
$username = "";
$password = "";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
$selected = mysql_select_db("",$dbh)
or die("Could not select database");
//----------------------------------
$result = mysql_query("SELECT selectedsomethinin gFROM somewhere");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$str = "$row[something]"; /*date */
print date('l, F d, Y h:i A',strtotime($str));
}
mysql_close($dbh);
This code is coverts TimeStampt to a readable form of time/date
print date('l, F d, Y h:i A',strtotime($str));
Where $str is the date.
My question is as follows:
Let's say the TimeStap row is $row[5].
I can't just do
str = $row[5];
print date('l, F d, Y h:i A',strtotime($str));
because it will not loop the date. It will only show the date for one message/topic/post and will show a blank for all the following posts/topics/messages. How do I convert the time and STILL have a loop.
When I say loop I mean something like this:
Let's say you have 3 topics. When I use your code (the code in the above post) I get this:
Topic1
Hello!
12340509
Topic2
HI!
123407654
Topic3
Hello to you!
123405676
With
str = $row[5];
print date('l, F d, Y h:i A',strtotime($str));
I get
Topic1
Hello!
Decemeber 12, 2002 12:12 PM
Topic2
HI!
Topic3
Hello to you!
See what I'm talking about?
Sorry for the long post again. I'm trying to be as descriptive as possible.