hey, i'm attempting to write a query i'm getting an error... can anyone spot it right off?
SELECT p.id product_id, p.description, p.contact_first_name, p.use_first_name, p.contact_last_name, p.use_last_name, p.contact_phone, p.use_phone, p.contact_cell_phone, p.use_cell_phone, p.contact_email, p.use_email, p.contact_fax, p.use_fax, p.listing_type, p.start_date, p.end_date, p.cost, g.id garage_temp_id g.address, g.city, g.state, g.zip, g.zip_plus, g.location, g.from_date, g.to_date, g.hours_from, g.hours_to, cm.name community_name, cm.id community_id FROM product_temp p, product_community_temp pcm, product_garage_temp g, community cm WHERE p.store_type = 'G' AND product_id = pcm.product_id AND pcm.community_id = community_id AND p.associate_id_ =32 AND p.session_id = '1e6fec743000db9bbcddf38983c36fae' ORDER BY cm.name Product Temp Query Failed
here's the code:
function qryGarageTemp( )
{
IF ( $this->DBconnect() )
{
$sql = "SELECT p.id product_id, p.description, p.contact_first_name, p.use_first_name, p.contact_last_name, ";
$sql .= "p.use_last_name, p.contact_phone, p.use_phone, p.contact_cell_phone, p.use_cell_phone, ";
$sql .= "p.contact_email, p.use_email, p.contact_fax, p.use_fax, p.listing_type, p.start_date, "
. "p.end_date, p.cost, g.id garage_temp_id g.address, g.city, g.state, g.zip, g.zip_plus, "
. "g.location, g.from_date, g.to_date, g.hours_from, g.hours_to, ";
$sql .= "cm.name community_name, cm.id community_id "
. "FROM product_temp p, product_community_temp pcm, product_garage_temp g, ";
$sql .= "community cm WHERE p.store_type = 'G' AND product_id = pcm.product_id ";
$sql .= " AND pcm.community_id = community_id AND p.associate_id_ =" . $_SESSION['valid_user_id']
. " AND p.session_id = '" . $_COOKIE['PHPSESSID'] . "'";
$sql .= " ORDER BY cm.name ";
print $sql . mysql_error();
$result1 = mysql_query($sql);
IF ( !$result1 ) RETURN FALSE;
RETURN $result1;
}
else
{
print "NO CONNECT";
RETURN FALSE;
}
}