What I’m trying to do is to fetch date and time from int(11) from mysql and display it in PHP:
<?php
$dbusername = 'dbuser';
$dbpassword = 'dbpassword';
$dbhost = 'localhost';
$dbname = 'dbname';
$conn = mysql_connect($dbhost,$dbusername,$dbpassword);
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
$conn = mysql_connect($dbhost,$dbusername,$dbpassword);
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname, $conn);
$query = "SELECT from_unixtime(mycolumn) FROM mytable";
?>
but the page loads and nothing shows up.
What’s wrong?
@Jeffrey said is right
but do not recommend call mysql function, you can try like this: