I am inserting data into a database like so.
$connection =@mysql_connect("", "", "") or die("Could not Connect.".mysql_error());
$db = @mysql_select_db('hells-fury_com', $connection) or die("Could not select database.".mysql_error());
$sql = "insert into software (name, size, description) values ('$name', '$size', '$description')";
$result = mysql_query($sql, $connection) or die("Unable to connect to database.".mysql_error());
I am trying to pull the date from the database liko so
$connection = @mysql_connect("$server", "$user", "$pass") or die("Could not Connect.");
$db = @mysql_select_db($dbname, $connection) or die("Could not select database.");
$sql = "SELECT user,news, date FROM news ORDER BY date ASC LIMIT 5";
$result = @($sql,$connection) or die("Could not execute query.");
while ($row = mysql_fetch_array($result)) {
echo ("<font face='Verdana' size='2'>$row[date] { $row[user] }<br>
$row[news]</font>");
}
I want the date inserted when you insert news and user. How do i do this. I cant seem to get it right. The date always stays the same. 0000-00-00