Running PHP 4.06 & Mysql 3.23.
If I run this query at the Mysql prompt it returns what I want. If I run it in PHP, it doesn't return anything. If I take out the date formatting I get a result.
I've tried returning the info into a php variable then using the PHP date formatting try to return the value but it doesn't recognise it and returns a 1970 year. The value stored in the Mysql field is '2001-10-1' etc.
<?php
echo "<html>\n<body>";
include ("config.inc"
$result = mysql_query("SELECT DATE_FORMAT(entrydate,'%D %b %Y') FROM convicts WHERE mail LIKE 'mymail%' ORDER BY entrydate DESC LIMIT 0, 1",$db);
while ($row = mysql_fetch_array($result)) {
$lastentry = $row["entrydate"];
echo "Last updated $lastentry\n";
}
echo "</body>\n</html>";
?>
If I run this query at the Mysql prompt it returns what I want. If I run it in PHP, it doesn't return anything. If I take out the date formatting I get a result.
I've tried returning the info into a php variable then using the PHP date formatting try to return the value but it doesn't recognise it and returns a 1970 year. The value stored in the Mysql field is '2001-10-1' etc.
<?php
echo "<html>\n<body>";
include ("config.inc"
$result = mysql_query("SELECT DATE_FORMAT(entrydate,'%D %b %Y') FROM convicts WHERE mail LIKE 'mymail%' ORDER BY entrydate DESC LIMIT 0, 1",$db);
while ($row = mysql_fetch_array($result)) {
$lastentry = $row["entrydate"];
echo "Last updated $lastentry\n";
}
echo "</body>\n</html>";
?>