PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
mjseaden
Forum Contributor
Posts: 458 Joined: Wed Mar 17, 2004 5:49 am
Post
by mjseaden » Fri Jul 16, 2004 4:44 am
You can access my database? Here's the code:
Code: Select all
$query = 'SELECT UNIX_TIMESTAMP(''CustomerViewFrom'') CustomerViewFrom FROM Customers';
$result = mysql_query($query);
if(!$result)
{
do_html_message('Error performing MySQL query - '.mysql_error());
do_html_footer();
exit();
}
$row = mysql_fetch_array($result);
echo $row['CustomerViewFrom'];
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Jul 16, 2004 4:54 am
ok.. it's because you have single quotes, not backticks..copy this exactly, for that line:
Code: Select all
$query = "SELECT UNIX_TIMESTAMP( `CustomerViewFrom` ) `CustomerViewFrom` FROM `Customers`";
mjseaden
Forum Contributor
Posts: 458 Joined: Wed Mar 17, 2004 5:49 am
Post
by mjseaden » Fri Jul 16, 2004 4:57 am
Hi feyd,
Thanks very much - really appreciate the help. I'm now getting the same output as yourself.
Cheers,
Mark