Hi Everyone

I have this code to show records from MySQL database in a table named vehicles, getting the following error, please help:

I have just moved this site from another server, were it was working fine, thanks for looking


$query = "SELECT * FROM ".$CFG->db_name.".vehicles WHERE live = '1' AND page = '".$page."'";
$q = mysql_query($query);
if (!$q) echo mysql_error();

if (mysql_num_rows($q) > 0)
$count = 1;
$prodno = mysql_num_rows($q);
include "js/code.js";
while ($r = mysql_fetch_array($q))


this is what it says in my browser;

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 '-web654fdh.vehicles WHERE live = '1' AND page = 'machinery'' at line 1