Jump to content

Recommended Posts

I'm a little rusty at this. I have a field in MySQL set to type of timestamp and I am displaying it in an HTML table and it displays as 2012-10-14 13:09:07. I would rather have at display as Sunday, October 14th at 3:09.

 

The code to pull the data is as follow:

 

<?php

mysql_connect("localhost","uname","pw");//database connection
mysql_select_db("DBName");

$SQL = "SELECT * FROM organization ORDER BY time_created_t ASC";


$result = mysql_query($SQL);    
lt

while($data = mysql_fetch_row($result)){
 echo("<tr><td>$data[1]</td><td>$data[2]</td><td>$data[3]</td><td>$data[4]</td><td>$data[5]</td><td>$data[6]</td><td>$data[7]</td><td>$data[8]</td><td>$data[9]</td><td>$data[10]</td><td>$data[11]</td><td>$data[12]</td></tr>");
}
?>

 

 

the timestamp is in <td>$data[12]</td>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.