Code:
<table width="50%" border="0">
<tr>
<td>Nummer</td>
<td>Titel</td>
<td>Datum</td>
</tr>
<?php
include "config.php";
// news.php
echo "News Archiv\n
";
$sql = "SELECT
ID,
Titel,
Datum
FROM
News
ORDER BY
Datum DESC";
$result = mysql_query($sql) OR die(mysql_error());
if(mysql_num_rows($result)) {
while($row = mysql_fetch_assoc($result)) {
/* echo "<table width=\"75%\" border=\"1\">";
echo "<tr>";
echo "<td>Nummer</td>";
echo "<td>Titel</td>";
echo "<td>Datum</td>";
echo "</tr>"; */
echo "<tr>";
echo "<td>";
echo $row['ID'];
echo "</td>";
echo "<td>";
echo $row['Titel'];
echo "</td>";
echo "<td>";
echo $row['Datum'];
echo "</td>";
echo "</tr>";
#echo "</table>";
}
} else {
echo"
Keine News vorhanden</p>\n";
}
mysql_close($db);
?>
</table>
Wie formatiere ich den nun Timestamp ich beschäftige mich noch nicht lange mit php / mysql ich möchte datum und uhrzeit ausgeben
Meine Tabelle habe ich so erstellt !
Code:
CREATE TABLE `news` (
`ID` int(11) NOT NULL auto_increment,
`Titel` varchar(100) default NULL,
`Inhalt` text,
`Datum` timestamp(14) NOT NULL,
PRIMARY KEY (`ID`)
) TYPE=MyISAM AUTO_INCREMENT=3 ;
Könnt ihr mir helfen Timestamp richtig zu formatieren danke.