Hey Folks,
I'm *trying* to understand this (and I've looked at examples in the Code Library) but it's just not hitting home.
I'm grabbing a MySQL table where one of the fields is set to "timestamp(14)". However, I'd like to reformat the timestamp into something more readable.
Here's the code -- the field name is "updated" in the last row shown. Any help is really appreciated!
* * * * *
$db = mysql_pconnect("localhost", "root");
mysql_select_db("marvster_links");
$result = mysql_query("select * from links_resources order by title");
$numrows = mysql_num_rows($result);
for ($row=1; $row<$numrows; $row++)
{
echo "<table border=1><tr>";
$linkurl = mysql_result($result,$row,"url");
echo "<td width=250 bgcolor='#CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf("<a href='http://www.phpbuilder.com/board/archive/index.php/$linkurl'>%s</a>", mysql_result($result,$row,"title")); echo "</td>";
echo "<td width=30><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"linksr_id")); echo "</td>";
echo "<td width=105><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"code_a")); echo "</td>";
echo "<td width=105><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"code_b")); echo "</td>";
echo "<td width=105><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"updated")); echo "</td>";
More....
I'm *trying* to understand this (and I've looked at examples in the Code Library) but it's just not hitting home.
I'm grabbing a MySQL table where one of the fields is set to "timestamp(14)". However, I'd like to reformat the timestamp into something more readable.
Here's the code -- the field name is "updated" in the last row shown. Any help is really appreciated!
* * * * *
$db = mysql_pconnect("localhost", "root");
mysql_select_db("marvster_links");
$result = mysql_query("select * from links_resources order by title");
$numrows = mysql_num_rows($result);
for ($row=1; $row<$numrows; $row++)
{
echo "<table border=1><tr>";
$linkurl = mysql_result($result,$row,"url");
echo "<td width=250 bgcolor='#CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf("<a href='http://www.phpbuilder.com/board/archive/index.php/$linkurl'>%s</a>", mysql_result($result,$row,"title")); echo "</td>";
echo "<td width=30><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"linksr_id")); echo "</td>";
echo "<td width=105><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"code_a")); echo "</td>";
echo "<td width=105><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"code_b")); echo "</td>";
echo "<td width=105><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>"; printf(mysql_result($result,$row,"updated")); echo "</td>";
More....