Hokay. Now I'm trying to return a value from a custom function, the modified date from the mysql database, formatted properly. This works perfectly if it's actually embedded into the script, doesnt work at all as a seperate included function.
PHP Code:
function getModDate($db_table) {
// modified date string
global $mod_date;
$mod_result = mysql_query("SELECT DATE_FORMAT(DATE_SUB(modified, INTERVAL 3 HOUR),
'%c/%d/%y @ %r') FROM $db_table ORDER BY modified DESC LIMIT 1");
$row = mysql_fetch_array($mod_result, MYSQL_NUM);
$mod_date = $row['0'];
return $mod_date;
}
Since the value of $mod_date is changed into a string on the last line, why wouldn't it just return that value?