Warning: mysql_query() [http://www.mysql.com/doc]: The used SELECT statements have a different number of columns in /home/majoncom/public_html/local/includes/platform/query.php on line 153 QUERY ERROR:The used SELECT statements have a different number of columnsSQL:SELECT * FROM ( SELECT content_75.id, content_75.profileid, content_75.URLid, content_75.address_URLid, content_75.userid, content_75.parentcategory_id, content_75.category_id, content_75.company, content_75.address, content_75.city, content_75.zip, content_75.state, content_75.county, content_75.phone, content_75.rating, content_75.owner_name, content_75.plan_id, users_editedprofiles.plan_id as theplan_id,content_75.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_75,users_editedprofiles WHERE content_75.state_id='8' AND users_editedprofiles.parentcategory_id='75' AND users_editedprofiles.content_id = content_75.id AND users_editedprofiles.plan_id != 0 AND (content_75.category_id='49100' OR content_75.category_id='53084') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_30.id, content_30.profileid, content_30.URLid, content_30.address_URLid, content_30.userid, content_30.parentcategory_id, content_30.category_id, content_30.company, content_30.address, content_30.city, content_30.zip, content_30.state, content_30.county, content_30.phone, content_30.rating, content_30.owner_name, content_30.plan_id, users_editedprofiles.plan_id as theplan_id,content_30.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_30,users_editedprofiles WHERE content_30.state_id='8' AND users_editedprofiles.parentcategory_id='30' AND users_editedprofiles.content_id = content_30.id AND users_editedprofiles.plan_id != 0 AND (content_30.category_id='69' OR content_30.category_id='87' OR content_30.category_id='51820' OR content_30.category_id='31' OR content_30.category_id='52336' OR content_30.category_id='49296' OR content_30.category_id='48385' OR content_30.category_id='51461') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_41.*, users_editedprofiles.*, content_41.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_41,users_editedprofiles,assigned_categories WHERE content_41.id = '251214' AND users_editedprofiles.parentcategory_id='41' AND users_editedprofiles.content_id = content_41.id AND users_editedprofiles.plan_id != 0 AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_28.id, content_28.profileid, content_28.URLid, content_28.address_URLid, content_28.userid, content_28.parentcategory_id, content_28.category_id, content_28.company, content_28.address, content_28.city, content_28.zip, content_28.state, content_28.county, content_28.phone, content_28.rating, content_28.owner_name, content_28.plan_id, users_editedprofiles.plan_id as theplan_id,content_28.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_28,users_editedprofiles WHERE content_28.state_id='8' AND users_editedprofiles.parentcategory_id='28' AND users_editedprofiles.content_id = content_28.id AND users_editedprofiles.plan_id != 0 AND (content_28.category_id='365' OR content_28.category_id='388' OR content_28.category_id='51843' OR content_28.category_id='53910' OR content_28.category_id='572' OR content_28.category_id='53837' OR content_28.category_id='49256' OR content_28.category_id='52925' OR content_28.category_id='49252' OR content_28.category_id='49258' OR content_28.category_id='51169' OR content_28.category_id='58838' OR content_28.category_id='51848' OR content_28.category_id='52317' OR content_28.category_id='56646' OR content_28.category_id='52105' OR content_28.category_id='52269' OR content_28.category_id='49251' OR content_28.category_id='57309' OR content_28.category_id='55874') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_273.id, content_273.profileid, content_273.URLid, content_273.address_URLid, content_273.userid, content_273.parentcategory_id, content_273.category_id, content_273.company, content_273.address, content_273.city, content_273.zip, content_273.state, content_273.county, content_273.phone, content_273.rating, content_273.owner_name, content_273.plan_id, users_editedprofiles.plan_id as theplan_id,content_273.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_273,users_editedprofiles WHERE content_273.state_id='8' AND users_editedprofiles.parentcategory_id='273' AND users_editedprofiles.content_id = content_273.id AND users_editedprofiles.plan_id != 0 AND (content_273.category_id='59015') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_25.id, content_25.profileid, content_25.URLid, content_25.address_URLid, content_25.userid, content_25.parentcategory_id, content_25.category_id, content_25.company, content_25.address, content_25.city, content_25.zip, content_25.state, content_25.county, content_25.phone, content_25.rating, content_25.owner_name, content_25.plan_id, users_editedprofiles.plan_id as theplan_id,content_25.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_25,users_editedprofiles WHERE content_25.state_id='8' AND users_editedprofiles.parentcategory_id='25' AND users_editedprofiles.content_id = content_25.id AND users_editedprofiles.plan_id != 0 AND (content_25.category_id='53078') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_80.id, content_80.profileid, content_80.URLid, content_80.address_URLid, content_80.userid, content_80.parentcategory_id, content_80.category_id, content_80.company, content_80.address, content_80.city, content_80.zip, content_80.state, content_80.county, content_80.phone, content_80.rating, content_80.owner_name, content_80.plan_id, users_editedprofiles.plan_id as theplan_id,content_80.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_80,users_editedprofiles WHERE content_80.state_id='8' AND users_editedprofiles.parentcategory_id='80' AND users_editedprofiles.content_id = content_80.id AND users_editedprofiles.plan_id != 0 AND (content_80.category_id='58104' OR content_80.category_id='58725') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_200.id, content_200.profileid, content_200.URLid, content_200.address_URLid, content_200.userid, content_200.parentcategory_id, content_200.category_id, content_200.company, content_200.address, content_200.city, content_200.zip, content_200.state, content_200.county, content_200.phone, content_200.rating, content_200.owner_name, content_200.plan_id, users_editedprofiles.plan_id as theplan_id,content_200.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_200,users_editedprofiles WHERE content_200.state_id='8' AND users_editedprofiles.parentcategory_id='200' AND users_editedprofiles.content_id = content_200.id AND users_editedprofiles.plan_id != 0 AND (content_200.category_id='52220' OR content_200.category_id='48934' OR content_200.category_id='51206' OR content_200.category_id='51546' OR content_200.category_id='237' OR content_200.category_id='52258') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_34.id, content_34.profileid, content_34.URLid, content_34.address_URLid, content_34.userid, content_34.parentcategory_id, content_34.category_id, content_34.company, content_34.address, content_34.city, content_34.zip, content_34.state, content_34.county, content_34.phone, content_34.rating, content_34.owner_name, content_34.plan_id, users_editedprofiles.plan_id as theplan_id,content_34.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_34,users_editedprofiles WHERE content_34.state_id='8' AND users_editedprofiles.parentcategory_id='34' AND users_editedprofiles.content_id = content_34.id AND users_editedprofiles.plan_id != 0 AND (content_34.category_id='48984') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_122.id, content_122.profileid, content_122.URLid, content_122.address_URLid, content_122.userid, content_122.parentcategory_id, content_122.category_id, content_122.company, content_122.address, content_122.city, content_122.zip, content_122.state, content_122.county, content_122.phone, content_122.rating, content_122.owner_name, content_122.plan_id, users_editedprofiles.plan_id as theplan_id,content_122.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_122,users_editedprofiles WHERE content_122.state_id='8' AND users_editedprofiles.parentcategory_id='122' AND users_editedprofiles.content_id = content_122.id AND users_editedprofiles.plan_id != 0 AND (content_122.category_id='51322') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_63.id, content_63.profileid, content_63.URLid, content_63.address_URLid, content_63.userid, content_63.parentcategory_id, content_63.category_id, content_63.company, content_63.address, content_63.city, content_63.zip, content_63.state, content_63.county, content_63.phone, content_63.rating, content_63.owner_name, content_63.plan_id, users_editedprofiles.plan_id as theplan_id,content_63.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_63,users_editedprofiles WHERE content_63.state_id='8' AND users_editedprofiles.parentcategory_id='63' AND users_editedprofiles.content_id = content_63.id AND users_editedprofiles.plan_id != 0 AND (content_63.category_id='47642' OR content_63.category_id='57233' OR content_63.category_id='47644') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 ORDER BY distance asc, theplan_id DESC, rating DESC) as t1 UNION SELECT * FROM ( SELECT content_75.id, content_75.profileid, content_75.URLid, content_75.address_URLid, content_75.userid, content_75.parentcategory_id, content_75.category_id, content_75.company, content_75.address, content_75.city, content_75.zip, content_75.state, content_75.county, content_75.phone, content_75.rating, content_75.owner_name, content_75.plan_id, 0 as nf_plan_id,content_75.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_75 WHERE state_id='8' AND (content_75.category_id='49100' OR content_75.category_id='53084') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_30.id, content_30.profileid, content_30.URLid, content_30.address_URLid, content_30.userid, content_30.parentcategory_id, content_30.category_id, content_30.company, content_30.address, content_30.city, content_30.zip, content_30.state, content_30.county, content_30.phone, content_30.rating, content_30.owner_name, content_30.plan_id, 0 as nf_plan_id,content_30.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_30 WHERE state_id='8' AND (content_30.category_id='69' OR content_30.category_id='87' OR content_30.category_id='51820' OR content_30.category_id='31' OR content_30.category_id='52336' OR content_30.category_id='49296' OR content_30.category_id='48385' OR content_30.category_id='51461') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_28.id, content_28.profileid, content_28.URLid, content_28.address_URLid, content_28.userid, content_28.parentcategory_id, content_28.category_id, content_28.company, content_28.address, content_28.city, content_28.zip, content_28.state, content_28.county, content_28.phone, content_28.rating, content_28.owner_name, content_28.plan_id, 0 as nf_plan_id,content_28.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_28 WHERE state_id='8' AND (content_28.category_id='365' OR content_28.category_id='388' OR content_28.category_id='51843' OR content_28.category_id='53910' OR content_28.category_id='572' OR content_28.category_id='53837' OR content_28.category_id='49256' OR content_28.category_id='52925' OR content_28.category_id='49252' OR content_28.category_id='49258' OR content_28.category_id='51169' OR content_28.category_id='58838' OR content_28.category_id='51848' OR content_28.category_id='52317' OR content_28.category_id='56646' OR content_28.category_id='52105' OR content_28.category_id='52269' OR content_28.category_id='49251' OR content_28.category_id='57309' OR content_28.category_id='55874') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_273.id, content_273.profileid, content_273.URLid, content_273.address_URLid, content_273.userid, content_273.parentcategory_id, content_273.category_id, content_273.company, content_273.address, content_273.city, content_273.zip, content_273.state, content_273.county, content_273.phone, content_273.rating, content_273.owner_name, content_273.plan_id, 0 as nf_plan_id,content_273.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_273 WHERE state_id='8' AND (content_273.category_id='59015') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_25.id, content_25.profileid, content_25.URLid, content_25.address_URLid, content_25.userid, content_25.parentcategory_id, content_25.category_id, content_25.company, content_25.address, content_25.city, content_25.zip, content_25.state, content_25.county, content_25.phone, content_25.rating, content_25.owner_name, content_25.plan_id, 0 as nf_plan_id,content_25.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_25 WHERE state_id='8' AND (content_25.category_id='53078') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_80.id, content_80.profileid, content_80.URLid, content_80.address_URLid, content_80.userid, content_80.parentcategory_id, content_80.category_id, content_80.company, content_80.address, content_80.city, content_80.zip, content_80.state, content_80.county, content_80.phone, content_80.rating, content_80.owner_name, content_80.plan_id, 0 as nf_plan_id,content_80.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_80 WHERE state_id='8' AND (content_80.category_id='58104' OR content_80.category_id='58725') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_200.id, content_200.profileid, content_200.URLid, content_200.address_URLid, content_200.userid, content_200.parentcategory_id, content_200.category_id, content_200.company, content_200.address, content_200.city, content_200.zip, content_200.state, content_200.county, content_200.phone, content_200.rating, content_200.owner_name, content_200.plan_id, 0 as nf_plan_id,content_200.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_200 WHERE state_id='8' AND (content_200.category_id='52220' OR content_200.category_id='48934' OR content_200.category_id='51206' OR content_200.category_id='51546' OR content_200.category_id='237' OR content_200.category_id='52258') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_34.id, content_34.profileid, content_34.URLid, content_34.address_URLid, content_34.userid, content_34.parentcategory_id, content_34.category_id, content_34.company, content_34.address, content_34.city, content_34.zip, content_34.state, content_34.county, content_34.phone, content_34.rating, content_34.owner_name, content_34.plan_id, 0 as nf_plan_id,content_34.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_34 WHERE state_id='8' AND (content_34.category_id='48984') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_122.id, content_122.profileid, content_122.URLid, content_122.address_URLid, content_122.userid, content_122.parentcategory_id, content_122.category_id, content_122.company, content_122.address, content_122.city, content_122.zip, content_122.state, content_122.county, content_122.phone, content_122.rating, content_122.owner_name, content_122.plan_id, 0 as nf_plan_id,content_122.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_122 WHERE state_id='8' AND (content_122.category_id='51322') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_63.id, content_63.profileid, content_63.URLid, content_63.address_URLid, content_63.userid, content_63.parentcategory_id, content_63.category_id, content_63.company, content_63.address, content_63.city, content_63.zip, content_63.state, content_63.county, content_63.phone, content_63.rating, content_63.owner_name, content_63.plan_id, 0 as nf_plan_id,content_63.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_63 WHERE state_id='8' AND (content_63.category_id='47642' OR content_63.category_id='57233' OR content_63.category_id='47644') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 ORDER BY distance asc, rating DESC) as t2 LIMIT 0,10 DB:businessdir_dec22 / businessdir Warning: mysql_query() [http://www.mysql.com/doc]: The used SELECT statements have a different number of columns in /home/majoncom/public_html/local/includes/platform/query.php on line 193 QUERY ERROR:The used SELECT statements have a different number of columnsSQL:SELECT * FROM ( SELECT content_75.id, content_75.profileid, content_75.URLid, content_75.address_URLid, content_75.userid, content_75.parentcategory_id, content_75.category_id, content_75.company, content_75.address, content_75.city, content_75.zip, content_75.state, content_75.county, content_75.phone, content_75.rating, content_75.owner_name, content_75.plan_id, users_editedprofiles.plan_id as theplan_id,content_75.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_75,users_editedprofiles WHERE content_75.state_id='8' AND users_editedprofiles.parentcategory_id='75' AND users_editedprofiles.content_id = content_75.id AND users_editedprofiles.plan_id != 0 AND (content_75.category_id='49100' OR content_75.category_id='53084') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_30.id, content_30.profileid, content_30.URLid, content_30.address_URLid, content_30.userid, content_30.parentcategory_id, content_30.category_id, content_30.company, content_30.address, content_30.city, content_30.zip, content_30.state, content_30.county, content_30.phone, content_30.rating, content_30.owner_name, content_30.plan_id, users_editedprofiles.plan_id as theplan_id,content_30.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_30,users_editedprofiles WHERE content_30.state_id='8' AND users_editedprofiles.parentcategory_id='30' AND users_editedprofiles.content_id = content_30.id AND users_editedprofiles.plan_id != 0 AND (content_30.category_id='69' OR content_30.category_id='87' OR content_30.category_id='51820' OR content_30.category_id='31' OR content_30.category_id='52336' OR content_30.category_id='49296' OR content_30.category_id='48385' OR content_30.category_id='51461') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_41.*, users_editedprofiles.*, content_41.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_41,users_editedprofiles,assigned_categories WHERE content_41.id = '251214' AND users_editedprofiles.parentcategory_id='41' AND users_editedprofiles.content_id = content_41.id AND users_editedprofiles.plan_id != 0 AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_28.id, content_28.profileid, content_28.URLid, content_28.address_URLid, content_28.userid, content_28.parentcategory_id, content_28.category_id, content_28.company, content_28.address, content_28.city, content_28.zip, content_28.state, content_28.county, content_28.phone, content_28.rating, content_28.owner_name, content_28.plan_id, users_editedprofiles.plan_id as theplan_id,content_28.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_28,users_editedprofiles WHERE content_28.state_id='8' AND users_editedprofiles.parentcategory_id='28' AND users_editedprofiles.content_id = content_28.id AND users_editedprofiles.plan_id != 0 AND (content_28.category_id='365' OR content_28.category_id='388' OR content_28.category_id='51843' OR content_28.category_id='53910' OR content_28.category_id='572' OR content_28.category_id='53837' OR content_28.category_id='49256' OR content_28.category_id='52925' OR content_28.category_id='49252' OR content_28.category_id='49258' OR content_28.category_id='51169' OR content_28.category_id='58838' OR content_28.category_id='51848' OR content_28.category_id='52317' OR content_28.category_id='56646' OR content_28.category_id='52105' OR content_28.category_id='52269' OR content_28.category_id='49251' OR content_28.category_id='57309' OR content_28.category_id='55874') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_273.id, content_273.profileid, content_273.URLid, content_273.address_URLid, content_273.userid, content_273.parentcategory_id, content_273.category_id, content_273.company, content_273.address, content_273.city, content_273.zip, content_273.state, content_273.county, content_273.phone, content_273.rating, content_273.owner_name, content_273.plan_id, users_editedprofiles.plan_id as theplan_id,content_273.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_273,users_editedprofiles WHERE content_273.state_id='8' AND users_editedprofiles.parentcategory_id='273' AND users_editedprofiles.content_id = content_273.id AND users_editedprofiles.plan_id != 0 AND (content_273.category_id='59015') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_25.id, content_25.profileid, content_25.URLid, content_25.address_URLid, content_25.userid, content_25.parentcategory_id, content_25.category_id, content_25.company, content_25.address, content_25.city, content_25.zip, content_25.state, content_25.county, content_25.phone, content_25.rating, content_25.owner_name, content_25.plan_id, users_editedprofiles.plan_id as theplan_id,content_25.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_25,users_editedprofiles WHERE content_25.state_id='8' AND users_editedprofiles.parentcategory_id='25' AND users_editedprofiles.content_id = content_25.id AND users_editedprofiles.plan_id != 0 AND (content_25.category_id='53078') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_80.id, content_80.profileid, content_80.URLid, content_80.address_URLid, content_80.userid, content_80.parentcategory_id, content_80.category_id, content_80.company, content_80.address, content_80.city, content_80.zip, content_80.state, content_80.county, content_80.phone, content_80.rating, content_80.owner_name, content_80.plan_id, users_editedprofiles.plan_id as theplan_id,content_80.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_80,users_editedprofiles WHERE content_80.state_id='8' AND users_editedprofiles.parentcategory_id='80' AND users_editedprofiles.content_id = content_80.id AND users_editedprofiles.plan_id != 0 AND (content_80.category_id='58104' OR content_80.category_id='58725') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_200.id, content_200.profileid, content_200.URLid, content_200.address_URLid, content_200.userid, content_200.parentcategory_id, content_200.category_id, content_200.company, content_200.address, content_200.city, content_200.zip, content_200.state, content_200.county, content_200.phone, content_200.rating, content_200.owner_name, content_200.plan_id, users_editedprofiles.plan_id as theplan_id,content_200.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_200,users_editedprofiles WHERE content_200.state_id='8' AND users_editedprofiles.parentcategory_id='200' AND users_editedprofiles.content_id = content_200.id AND users_editedprofiles.plan_id != 0 AND (content_200.category_id='52220' OR content_200.category_id='48934' OR content_200.category_id='51206' OR content_200.category_id='51546' OR content_200.category_id='237' OR content_200.category_id='52258') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_34.id, content_34.profileid, content_34.URLid, content_34.address_URLid, content_34.userid, content_34.parentcategory_id, content_34.category_id, content_34.company, content_34.address, content_34.city, content_34.zip, content_34.state, content_34.county, content_34.phone, content_34.rating, content_34.owner_name, content_34.plan_id, users_editedprofiles.plan_id as theplan_id,content_34.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_34,users_editedprofiles WHERE content_34.state_id='8' AND users_editedprofiles.parentcategory_id='34' AND users_editedprofiles.content_id = content_34.id AND users_editedprofiles.plan_id != 0 AND (content_34.category_id='48984') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_122.id, content_122.profileid, content_122.URLid, content_122.address_URLid, content_122.userid, content_122.parentcategory_id, content_122.category_id, content_122.company, content_122.address, content_122.city, content_122.zip, content_122.state, content_122.county, content_122.phone, content_122.rating, content_122.owner_name, content_122.plan_id, users_editedprofiles.plan_id as theplan_id,content_122.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_122,users_editedprofiles WHERE content_122.state_id='8' AND users_editedprofiles.parentcategory_id='122' AND users_editedprofiles.content_id = content_122.id AND users_editedprofiles.plan_id != 0 AND (content_122.category_id='51322') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 UNION SELECT content_63.id, content_63.profileid, content_63.URLid, content_63.address_URLid, content_63.userid, content_63.parentcategory_id, content_63.category_id, content_63.company, content_63.address, content_63.city, content_63.zip, content_63.state, content_63.county, content_63.phone, content_63.rating, content_63.owner_name, content_63.plan_id, users_editedprofiles.plan_id as theplan_id,content_63.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_63,users_editedprofiles WHERE content_63.state_id='8' AND users_editedprofiles.parentcategory_id='63' AND users_editedprofiles.content_id = content_63.id AND users_editedprofiles.plan_id != 0 AND (content_63.category_id='47642' OR content_63.category_id='57233' OR content_63.category_id='47644') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 ORDER BY distance asc, theplan_id DESC, rating DESC) as t1 UNION SELECT * FROM ( SELECT content_75.id, content_75.profileid, content_75.URLid, content_75.address_URLid, content_75.userid, content_75.parentcategory_id, content_75.category_id, content_75.company, content_75.address, content_75.city, content_75.zip, content_75.state, content_75.county, content_75.phone, content_75.rating, content_75.owner_name, content_75.plan_id, 0 as nf_plan_id,content_75.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_75 WHERE state_id='8' AND (content_75.category_id='49100' OR content_75.category_id='53084') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_30.id, content_30.profileid, content_30.URLid, content_30.address_URLid, content_30.userid, content_30.parentcategory_id, content_30.category_id, content_30.company, content_30.address, content_30.city, content_30.zip, content_30.state, content_30.county, content_30.phone, content_30.rating, content_30.owner_name, content_30.plan_id, 0 as nf_plan_id,content_30.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_30 WHERE state_id='8' AND (content_30.category_id='69' OR content_30.category_id='87' OR content_30.category_id='51820' OR content_30.category_id='31' OR content_30.category_id='52336' OR content_30.category_id='49296' OR content_30.category_id='48385' OR content_30.category_id='51461') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_28.id, content_28.profileid, content_28.URLid, content_28.address_URLid, content_28.userid, content_28.parentcategory_id, content_28.category_id, content_28.company, content_28.address, content_28.city, content_28.zip, content_28.state, content_28.county, content_28.phone, content_28.rating, content_28.owner_name, content_28.plan_id, 0 as nf_plan_id,content_28.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_28 WHERE state_id='8' AND (content_28.category_id='365' OR content_28.category_id='388' OR content_28.category_id='51843' OR content_28.category_id='53910' OR content_28.category_id='572' OR content_28.category_id='53837' OR content_28.category_id='49256' OR content_28.category_id='52925' OR content_28.category_id='49252' OR content_28.category_id='49258' OR content_28.category_id='51169' OR content_28.category_id='58838' OR content_28.category_id='51848' OR content_28.category_id='52317' OR content_28.category_id='56646' OR content_28.category_id='52105' OR content_28.category_id='52269' OR content_28.category_id='49251' OR content_28.category_id='57309' OR content_28.category_id='55874') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_273.id, content_273.profileid, content_273.URLid, content_273.address_URLid, content_273.userid, content_273.parentcategory_id, content_273.category_id, content_273.company, content_273.address, content_273.city, content_273.zip, content_273.state, content_273.county, content_273.phone, content_273.rating, content_273.owner_name, content_273.plan_id, 0 as nf_plan_id,content_273.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_273 WHERE state_id='8' AND (content_273.category_id='59015') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_25.id, content_25.profileid, content_25.URLid, content_25.address_URLid, content_25.userid, content_25.parentcategory_id, content_25.category_id, content_25.company, content_25.address, content_25.city, content_25.zip, content_25.state, content_25.county, content_25.phone, content_25.rating, content_25.owner_name, content_25.plan_id, 0 as nf_plan_id,content_25.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_25 WHERE state_id='8' AND (content_25.category_id='53078') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_80.id, content_80.profileid, content_80.URLid, content_80.address_URLid, content_80.userid, content_80.parentcategory_id, content_80.category_id, content_80.company, content_80.address, content_80.city, content_80.zip, content_80.state, content_80.county, content_80.phone, content_80.rating, content_80.owner_name, content_80.plan_id, 0 as nf_plan_id,content_80.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_80 WHERE state_id='8' AND (content_80.category_id='58104' OR content_80.category_id='58725') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_200.id, content_200.profileid, content_200.URLid, content_200.address_URLid, content_200.userid, content_200.parentcategory_id, content_200.category_id, content_200.company, content_200.address, content_200.city, content_200.zip, content_200.state, content_200.county, content_200.phone, content_200.rating, content_200.owner_name, content_200.plan_id, 0 as nf_plan_id,content_200.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_200 WHERE state_id='8' AND (content_200.category_id='52220' OR content_200.category_id='48934' OR content_200.category_id='51206' OR content_200.category_id='51546' OR content_200.category_id='237' OR content_200.category_id='52258') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_34.id, content_34.profileid, content_34.URLid, content_34.address_URLid, content_34.userid, content_34.parentcategory_id, content_34.category_id, content_34.company, content_34.address, content_34.city, content_34.zip, content_34.state, content_34.county, content_34.phone, content_34.rating, content_34.owner_name, content_34.plan_id, 0 as nf_plan_id,content_34.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_34 WHERE state_id='8' AND (content_34.category_id='48984') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_122.id, content_122.profileid, content_122.URLid, content_122.address_URLid, content_122.userid, content_122.parentcategory_id, content_122.category_id, content_122.company, content_122.address, content_122.city, content_122.zip, content_122.state, content_122.county, content_122.phone, content_122.rating, content_122.owner_name, content_122.plan_id, 0 as nf_plan_id,content_122.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_122 WHERE state_id='8' AND (content_122.category_id='51322') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 UNION SELECT content_63.id, content_63.profileid, content_63.URLid, content_63.address_URLid, content_63.userid, content_63.parentcategory_id, content_63.category_id, content_63.company, content_63.address, content_63.city, content_63.zip, content_63.state, content_63.county, content_63.phone, content_63.rating, content_63.owner_name, content_63.plan_id, 0 as nf_plan_id,content_63.id as content_id,TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) AS distance FROM content_63 WHERE state_id='8' AND (content_63.category_id='47642' OR content_63.category_id='57233' OR content_63.category_id='47644') AND TRUNCATE((DEGREES(ACOS(SIN(RADIANS(37.41780090332)) * SIN(RADIANS(lat)) + COS(RADIANS(37.41780090332)) * COS(RADIANS(lat)) * COS(RADIANS(-122.17199707031 - `long`)) )) * 60 * 1.1515),1) < 50 AND plan_id = 0 ORDER BY distance asc, rating DESC) as t2 LIMIT 0,10 DB:businessdir_dec22 / businessdir