GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 19-Jun-2005, 06:29
jcgkiwi jcgkiwi is offline
New Member
 
Join Date: Jun 2005
Posts: 1
jcgkiwi is on a distinguished road
Question

Date and time formats from mysql


Hi,
This is my first post...
I am just starting out using php & mysql and am trying to display results containing date and time fields.
see www.jcgkiwi.net.nz
I have found lots of useful tips to JUST extract the date & time in the correct format, but how do you display it correctly when it is in the middle of other data???
here is my php...

PHP Code:

$query="SELECT * FROM stats";

$result=mysql_query($query);

echo "<p class=\"title\">2005 Papamoa VFB Stats<br></p>";

echo "<table class=\"tbl\"><tr><td class=\"stat\">Call #</td><td class=\"stat\">Date</td><td class=\"stat\">Time</td><td class=\"stat\">Appliances</td><td class=\"stat\">Address</td><td class=\"stat\">Call Description</td><td class=\"stat\">Details</td></tr>";

while($row = mysql_fetch_array($result))
{
    echo"<tr><td class=\"stat1\">" . $row[1] ."<br>". $row[2] . "</td><td class=\"stat1\">" . $row[3] . "</td><td class=\"stat1\">" . $row[4] . "</td><td class=\"stat1\">" . $row[5] . "</td><td class=\"stat\">" . $row[6] . "</td><td class=\"stat\">" . $row[7] . "</td><td class=\"stat\">" . $row[8] . "</td></tr>";
} 

echo "</table>"; 




Any help would be appreciated thanks.
Last edited by LuciWiz : 19-Jun-2005 at 06:38. Reason: Please insert your Php code between [php] & [/php] tags
  #2  
Old 21-Jun-2005, 09:37
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
The are many ways you can do this, we discuss some of these ideas here: http://www.gidforums.com/t-6075.html.
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Get the date / time difference with PHP admin PHP Code Library 4 16-Nov-2006 00:43
Limit combo box and date time picker choice according to database created in folder shinyhui C++ Forum 0 22-Feb-2005 21:16
Limit combo box and date time picker choice according to database created in folder shinyhui MS Visual C++ / MFC Forum 0 22-Feb-2005 03:13
Re: Programming Techniques WaltP C Programming Language 0 10-Mar-2004 00:56

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:30.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.