Getting this error:
"You have an error in your SQL syntax. Check the manual
that corresponds to your MySQL server version for the
right syntax to use near 'from games, teams v, teams h,
_fields f where g.homeid = h.id"
Here is my SQL:
$db->connect($dbhost, $dbuser, $dbpw, $dbname,
$pconnect);
$sql = "select g.gamenum, h.teamname, v.teamname, "
$sql = $sql."DAYNAME(g.gamedate) gamedayname,"
$sql = $sql."DAYOFMONTH(g.gamedate) gamedaynum,"
$sql = $sql."lower(date_format(g.gamedate, '%l:%i'))"
$sql = $sql."gametime, f.field_name, from games g, teams"
$sql = $sql."v, teams h, _fields f where"
$sql = $sql."g.homeid = h.id and g.visitorid = v.id and "
$sql = $sql."f.id = g.fieldid and "
$sql = $sql."(g.homeid=".$team." or g.visitorid=".$team.")"
$sql = $sql."order by g.gamenum";
$query = $db->query($sql);
Using 4.0.12 on Win2K.
I have the same SQL working in another script on my site using
4.0.12 on Linux.