i need to modify this query

$fields = array("lo.name", "lo.id", "lo.status", "lo.sales_status", "pt.name ptname", "lo.city", "st.name state", "co.name country", "lo.zip", "lo.phone", "lo.email");
$result = $select->selectQuery($fields, "locations lo","LEFT JOIN states st ON st.id = lo.state LEFT JOIN countries co ON co.id = lo.country LEFT JOIN location_types pt ON pt.id = lo.primary_type");

like this but its not working please help

$result = mysql_query("SELECT lo.name,lo.id,lo.status,lo.sales_status,pt.name as ptname,lo.city,st.name  as state,co.name as country,lo.zip,lo.phone,lo.email FROM locations lo,LEFT JOIN states st ON st.id = lo.state LEFT JOIN countries co ON co.id = lo.country LEFT JOIN location_types pt ON pt.id = lo.primary_type");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.