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_17.id, content_17.profileid, content_17.URLid, content_17.address_URLid, content_17.userid, content_17.parentcategory_id, content_17.category_id, content_17.company, content_17.address, content_17.city, content_17.zip, content_17.state, content_17.county, content_17.phone, content_17.rating, content_17.owner_name, content_17.plan_id, users_editedprofiles.plan_id as theplan_id,content_17.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_17,users_editedprofiles WHERE content_17.state_id='8' AND users_editedprofiles.parentcategory_id='17' AND users_editedprofiles.content_id = content_17.id AND users_editedprofiles.plan_id != 0 AND (content_17.category_id='53167' OR content_17.category_id='53300' OR content_17.category_id='57445' OR content_17.category_id='53097' OR content_17.category_id='529' OR content_17.category_id='49211' OR content_17.category_id='51361' OR content_17.category_id='53023' OR content_17.category_id='51614' OR content_17.category_id='53681' OR content_17.category_id='51345' OR content_17.category_id='53873' OR content_17.category_id='49206' OR content_17.category_id='49193' OR content_17.category_id='53853' OR content_17.category_id='410' OR content_17.category_id='18' OR content_17.category_id='51216' OR content_17.category_id='49204' OR content_17.category_id='53176' OR content_17.category_id='53032' OR content_17.category_id='51600' OR content_17.category_id='49197' OR content_17.category_id='60139' OR content_17.category_id='51602' OR content_17.category_id='50994' OR content_17.category_id='52266' OR content_17.category_id='57022' OR content_17.category_id='51743' OR content_17.category_id='49194' OR content_17.category_id='51585' OR content_17.category_id='51851' OR content_17.category_id='51744' OR content_17.category_id='52736' OR content_17.category_id='49198' OR content_17.category_id='205' OR content_17.category_id='46172' OR content_17.category_id='358' OR content_17.category_id='52947' OR content_17.category_id='46145') 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_70.id, content_70.profileid, content_70.URLid, content_70.address_URLid, content_70.userid, content_70.parentcategory_id, content_70.category_id, content_70.company, content_70.address, content_70.city, content_70.zip, content_70.state, content_70.county, content_70.phone, content_70.rating, content_70.owner_name, content_70.plan_id, users_editedprofiles.plan_id as theplan_id,content_70.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_70,users_editedprofiles WHERE content_70.state_id='8' AND users_editedprofiles.parentcategory_id='70' AND users_editedprofiles.content_id = content_70.id AND users_editedprofiles.plan_id != 0 AND (content_70.category_id='51510' OR content_70.category_id='53874') 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_9.id, content_9.profileid, content_9.URLid, content_9.address_URLid, content_9.userid, content_9.parentcategory_id, content_9.category_id, content_9.company, content_9.address, content_9.city, content_9.zip, content_9.state, content_9.county, content_9.phone, content_9.rating, content_9.owner_name, content_9.plan_id, users_editedprofiles.plan_id as theplan_id,content_9.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_9,users_editedprofiles WHERE content_9.state_id='8' AND users_editedprofiles.parentcategory_id='9' AND users_editedprofiles.content_id = content_9.id AND users_editedprofiles.plan_id != 0 AND (content_9.category_id='228' OR content_9.category_id='693') 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='51820' OR content_30.category_id='87') 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_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='44296' OR content_80.category_id='54278' OR content_80.category_id='180') 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_97.id, content_97.profileid, content_97.URLid, content_97.address_URLid, content_97.userid, content_97.parentcategory_id, content_97.category_id, content_97.company, content_97.address, content_97.city, content_97.zip, content_97.state, content_97.county, content_97.phone, content_97.rating, content_97.owner_name, content_97.plan_id, users_editedprofiles.plan_id as theplan_id,content_97.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_97,users_editedprofiles WHERE content_97.state_id='8' AND users_editedprofiles.parentcategory_id='97' AND users_editedprofiles.content_id = content_97.id AND users_editedprofiles.plan_id != 0 AND (content_97.category_id='53293') 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_47.id, content_47.profileid, content_47.URLid, content_47.address_URLid, content_47.userid, content_47.parentcategory_id, content_47.category_id, content_47.company, content_47.address, content_47.city, content_47.zip, content_47.state, content_47.county, content_47.phone, content_47.rating, content_47.owner_name, content_47.plan_id, users_editedprofiles.plan_id as theplan_id,content_47.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_47,users_editedprofiles WHERE content_47.state_id='8' AND users_editedprofiles.parentcategory_id='47' AND users_editedprofiles.content_id = content_47.id AND users_editedprofiles.plan_id != 0 AND (content_47.category_id='49007' OR content_47.category_id='48990') 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_5.id, content_5.profileid, content_5.URLid, content_5.address_URLid, content_5.userid, content_5.parentcategory_id, content_5.category_id, content_5.company, content_5.address, content_5.city, content_5.zip, content_5.state, content_5.county, content_5.phone, content_5.rating, content_5.owner_name, content_5.plan_id, users_editedprofiles.plan_id as theplan_id,content_5.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_5,users_editedprofiles WHERE content_5.state_id='8' AND users_editedprofiles.parentcategory_id='5' AND users_editedprofiles.content_id = content_5.id AND users_editedprofiles.plan_id != 0 AND (content_5.category_id='56547') 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.id, content_41.profileid, content_41.URLid, content_41.address_URLid, content_41.userid, content_41.parentcategory_id, content_41.category_id, content_41.company, content_41.address, content_41.city, content_41.zip, content_41.state, content_41.county, content_41.phone, content_41.rating, content_41.owner_name, content_41.plan_id, users_editedprofiles.plan_id as theplan_id,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 WHERE content_41.state_id='8' AND users_editedprofiles.parentcategory_id='41' AND users_editedprofiles.content_id = content_41.id AND users_editedprofiles.plan_id != 0 AND (content_41.category_id='56891' OR content_41.category_id='48919') 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='52706' OR content_25.category_id='51590') 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_17.id, content_17.profileid, content_17.URLid, content_17.address_URLid, content_17.userid, content_17.parentcategory_id, content_17.category_id, content_17.company, content_17.address, content_17.city, content_17.zip, content_17.state, content_17.county, content_17.phone, content_17.rating, content_17.owner_name, content_17.plan_id, 0 as nf_plan_id,content_17.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_17 WHERE state_id='8' AND (content_17.category_id='53167' OR content_17.category_id='53300' OR content_17.category_id='57445' OR content_17.category_id='53097' OR content_17.category_id='529' OR content_17.category_id='49211' OR content_17.category_id='51361' OR content_17.category_id='53023' OR content_17.category_id='51614' OR content_17.category_id='53681' OR content_17.category_id='51345' OR content_17.category_id='53873' OR content_17.category_id='49206' OR content_17.category_id='49193' OR content_17.category_id='53853' OR content_17.category_id='410' OR content_17.category_id='18' OR content_17.category_id='51216' OR content_17.category_id='49204' OR content_17.category_id='53176' OR content_17.category_id='53032' OR content_17.category_id='51600' OR content_17.category_id='49197' OR content_17.category_id='60139' OR content_17.category_id='51602' OR content_17.category_id='50994' OR content_17.category_id='52266' OR content_17.category_id='57022' OR content_17.category_id='51743' OR content_17.category_id='49194' OR content_17.category_id='51585' OR content_17.category_id='51851' OR content_17.category_id='51744' OR content_17.category_id='52736' OR content_17.category_id='49198' OR content_17.category_id='205' OR content_17.category_id='46172' OR content_17.category_id='358' OR content_17.category_id='52947' OR content_17.category_id='46145') 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_70.id, content_70.profileid, content_70.URLid, content_70.address_URLid, content_70.userid, content_70.parentcategory_id, content_70.category_id, content_70.company, content_70.address, content_70.city, content_70.zip, content_70.state, content_70.county, content_70.phone, content_70.rating, content_70.owner_name, content_70.plan_id, 0 as nf_plan_id,content_70.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_70 WHERE state_id='8' AND (content_70.category_id='51510' OR content_70.category_id='53874') 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_9.id, content_9.profileid, content_9.URLid, content_9.address_URLid, content_9.userid, content_9.parentcategory_id, content_9.category_id, content_9.company, content_9.address, content_9.city, content_9.zip, content_9.state, content_9.county, content_9.phone, content_9.rating, content_9.owner_name, content_9.plan_id, 0 as nf_plan_id,content_9.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_9 WHERE state_id='8' AND (content_9.category_id='228' OR content_9.category_id='693') 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='51820' OR content_30.category_id='87') 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='44296' OR content_80.category_id='54278' OR content_80.category_id='180') 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_97.id, content_97.profileid, content_97.URLid, content_97.address_URLid, content_97.userid, content_97.parentcategory_id, content_97.category_id, content_97.company, content_97.address, content_97.city, content_97.zip, content_97.state, content_97.county, content_97.phone, content_97.rating, content_97.owner_name, content_97.plan_id, 0 as nf_plan_id,content_97.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_97 WHERE state_id='8' AND (content_97.category_id='53293') 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_47.id, content_47.profileid, content_47.URLid, content_47.address_URLid, content_47.userid, content_47.parentcategory_id, content_47.category_id, content_47.company, content_47.address, content_47.city, content_47.zip, content_47.state, content_47.county, content_47.phone, content_47.rating, content_47.owner_name, content_47.plan_id, 0 as nf_plan_id,content_47.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_47 WHERE state_id='8' AND (content_47.category_id='49007' OR content_47.category_id='48990') 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_5.id, content_5.profileid, content_5.URLid, content_5.address_URLid, content_5.userid, content_5.parentcategory_id, content_5.category_id, content_5.company, content_5.address, content_5.city, content_5.zip, content_5.state, content_5.county, content_5.phone, content_5.rating, content_5.owner_name, content_5.plan_id, 0 as nf_plan_id,content_5.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_5 WHERE state_id='8' AND (content_5.category_id='56547') 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_41.id, content_41.profileid, content_41.URLid, content_41.address_URLid, content_41.userid, content_41.parentcategory_id, content_41.category_id, content_41.company, content_41.address, content_41.city, content_41.zip, content_41.state, content_41.county, content_41.phone, content_41.rating, content_41.owner_name, content_41.plan_id, 0 as nf_plan_id,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 WHERE state_id='8' AND (content_41.category_id='56891' OR content_41.category_id='48919') 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='52706' OR content_25.category_id='51590') 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_17.id, content_17.profileid, content_17.URLid, content_17.address_URLid, content_17.userid, content_17.parentcategory_id, content_17.category_id, content_17.company, content_17.address, content_17.city, content_17.zip, content_17.state, content_17.county, content_17.phone, content_17.rating, content_17.owner_name, content_17.plan_id, users_editedprofiles.plan_id as theplan_id,content_17.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_17,users_editedprofiles WHERE content_17.state_id='8' AND users_editedprofiles.parentcategory_id='17' AND users_editedprofiles.content_id = content_17.id AND users_editedprofiles.plan_id != 0 AND (content_17.category_id='53167' OR content_17.category_id='53300' OR content_17.category_id='57445' OR content_17.category_id='53097' OR content_17.category_id='529' OR content_17.category_id='49211' OR content_17.category_id='51361' OR content_17.category_id='53023' OR content_17.category_id='51614' OR content_17.category_id='53681' OR content_17.category_id='51345' OR content_17.category_id='53873' OR content_17.category_id='49206' OR content_17.category_id='49193' OR content_17.category_id='53853' OR content_17.category_id='410' OR content_17.category_id='18' OR content_17.category_id='51216' OR content_17.category_id='49204' OR content_17.category_id='53176' OR content_17.category_id='53032' OR content_17.category_id='51600' OR content_17.category_id='49197' OR content_17.category_id='60139' OR content_17.category_id='51602' OR content_17.category_id='50994' OR content_17.category_id='52266' OR content_17.category_id='57022' OR content_17.category_id='51743' OR content_17.category_id='49194' OR content_17.category_id='51585' OR content_17.category_id='51851' OR content_17.category_id='51744' OR content_17.category_id='52736' OR content_17.category_id='49198' OR content_17.category_id='205' OR content_17.category_id='46172' OR content_17.category_id='358' OR content_17.category_id='52947' OR content_17.category_id='46145') 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_70.id, content_70.profileid, content_70.URLid, content_70.address_URLid, content_70.userid, content_70.parentcategory_id, content_70.category_id, content_70.company, content_70.address, content_70.city, content_70.zip, content_70.state, content_70.county, content_70.phone, content_70.rating, content_70.owner_name, content_70.plan_id, users_editedprofiles.plan_id as theplan_id,content_70.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_70,users_editedprofiles WHERE content_70.state_id='8' AND users_editedprofiles.parentcategory_id='70' AND users_editedprofiles.content_id = content_70.id AND users_editedprofiles.plan_id != 0 AND (content_70.category_id='51510' OR content_70.category_id='53874') 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_9.id, content_9.profileid, content_9.URLid, content_9.address_URLid, content_9.userid, content_9.parentcategory_id, content_9.category_id, content_9.company, content_9.address, content_9.city, content_9.zip, content_9.state, content_9.county, content_9.phone, content_9.rating, content_9.owner_name, content_9.plan_id, users_editedprofiles.plan_id as theplan_id,content_9.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_9,users_editedprofiles WHERE content_9.state_id='8' AND users_editedprofiles.parentcategory_id='9' AND users_editedprofiles.content_id = content_9.id AND users_editedprofiles.plan_id != 0 AND (content_9.category_id='228' OR content_9.category_id='693') 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='51820' OR content_30.category_id='87') 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_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='44296' OR content_80.category_id='54278' OR content_80.category_id='180') 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_97.id, content_97.profileid, content_97.URLid, content_97.address_URLid, content_97.userid, content_97.parentcategory_id, content_97.category_id, content_97.company, content_97.address, content_97.city, content_97.zip, content_97.state, content_97.county, content_97.phone, content_97.rating, content_97.owner_name, content_97.plan_id, users_editedprofiles.plan_id as theplan_id,content_97.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_97,users_editedprofiles WHERE content_97.state_id='8' AND users_editedprofiles.parentcategory_id='97' AND users_editedprofiles.content_id = content_97.id AND users_editedprofiles.plan_id != 0 AND (content_97.category_id='53293') 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_47.id, content_47.profileid, content_47.URLid, content_47.address_URLid, content_47.userid, content_47.parentcategory_id, content_47.category_id, content_47.company, content_47.address, content_47.city, content_47.zip, content_47.state, content_47.county, content_47.phone, content_47.rating, content_47.owner_name, content_47.plan_id, users_editedprofiles.plan_id as theplan_id,content_47.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_47,users_editedprofiles WHERE content_47.state_id='8' AND users_editedprofiles.parentcategory_id='47' AND users_editedprofiles.content_id = content_47.id AND users_editedprofiles.plan_id != 0 AND (content_47.category_id='49007' OR content_47.category_id='48990') 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_5.id, content_5.profileid, content_5.URLid, content_5.address_URLid, content_5.userid, content_5.parentcategory_id, content_5.category_id, content_5.company, content_5.address, content_5.city, content_5.zip, content_5.state, content_5.county, content_5.phone, content_5.rating, content_5.owner_name, content_5.plan_id, users_editedprofiles.plan_id as theplan_id,content_5.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_5,users_editedprofiles WHERE content_5.state_id='8' AND users_editedprofiles.parentcategory_id='5' AND users_editedprofiles.content_id = content_5.id AND users_editedprofiles.plan_id != 0 AND (content_5.category_id='56547') 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.id, content_41.profileid, content_41.URLid, content_41.address_URLid, content_41.userid, content_41.parentcategory_id, content_41.category_id, content_41.company, content_41.address, content_41.city, content_41.zip, content_41.state, content_41.county, content_41.phone, content_41.rating, content_41.owner_name, content_41.plan_id, users_editedprofiles.plan_id as theplan_id,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 WHERE content_41.state_id='8' AND users_editedprofiles.parentcategory_id='41' AND users_editedprofiles.content_id = content_41.id AND users_editedprofiles.plan_id != 0 AND (content_41.category_id='56891' OR content_41.category_id='48919') 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='52706' OR content_25.category_id='51590') 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_17.id, content_17.profileid, content_17.URLid, content_17.address_URLid, content_17.userid, content_17.parentcategory_id, content_17.category_id, content_17.company, content_17.address, content_17.city, content_17.zip, content_17.state, content_17.county, content_17.phone, content_17.rating, content_17.owner_name, content_17.plan_id, 0 as nf_plan_id,content_17.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_17 WHERE state_id='8' AND (content_17.category_id='53167' OR content_17.category_id='53300' OR content_17.category_id='57445' OR content_17.category_id='53097' OR content_17.category_id='529' OR content_17.category_id='49211' OR content_17.category_id='51361' OR content_17.category_id='53023' OR content_17.category_id='51614' OR content_17.category_id='53681' OR content_17.category_id='51345' OR content_17.category_id='53873' OR content_17.category_id='49206' OR content_17.category_id='49193' OR content_17.category_id='53853' OR content_17.category_id='410' OR content_17.category_id='18' OR content_17.category_id='51216' OR content_17.category_id='49204' OR content_17.category_id='53176' OR content_17.category_id='53032' OR content_17.category_id='51600' OR content_17.category_id='49197' OR content_17.category_id='60139' OR content_17.category_id='51602' OR content_17.category_id='50994' OR content_17.category_id='52266' OR content_17.category_id='57022' OR content_17.category_id='51743' OR content_17.category_id='49194' OR content_17.category_id='51585' OR content_17.category_id='51851' OR content_17.category_id='51744' OR content_17.category_id='52736' OR content_17.category_id='49198' OR content_17.category_id='205' OR content_17.category_id='46172' OR content_17.category_id='358' OR content_17.category_id='52947' OR content_17.category_id='46145') 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_70.id, content_70.profileid, content_70.URLid, content_70.address_URLid, content_70.userid, content_70.parentcategory_id, content_70.category_id, content_70.company, content_70.address, content_70.city, content_70.zip, content_70.state, content_70.county, content_70.phone, content_70.rating, content_70.owner_name, content_70.plan_id, 0 as nf_plan_id,content_70.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_70 WHERE state_id='8' AND (content_70.category_id='51510' OR content_70.category_id='53874') 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_9.id, content_9.profileid, content_9.URLid, content_9.address_URLid, content_9.userid, content_9.parentcategory_id, content_9.category_id, content_9.company, content_9.address, content_9.city, content_9.zip, content_9.state, content_9.county, content_9.phone, content_9.rating, content_9.owner_name, content_9.plan_id, 0 as nf_plan_id,content_9.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_9 WHERE state_id='8' AND (content_9.category_id='228' OR content_9.category_id='693') 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='51820' OR content_30.category_id='87') 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='44296' OR content_80.category_id='54278' OR content_80.category_id='180') 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_97.id, content_97.profileid, content_97.URLid, content_97.address_URLid, content_97.userid, content_97.parentcategory_id, content_97.category_id, content_97.company, content_97.address, content_97.city, content_97.zip, content_97.state, content_97.county, content_97.phone, content_97.rating, content_97.owner_name, content_97.plan_id, 0 as nf_plan_id,content_97.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_97 WHERE state_id='8' AND (content_97.category_id='53293') 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_47.id, content_47.profileid, content_47.URLid, content_47.address_URLid, content_47.userid, content_47.parentcategory_id, content_47.category_id, content_47.company, content_47.address, content_47.city, content_47.zip, content_47.state, content_47.county, content_47.phone, content_47.rating, content_47.owner_name, content_47.plan_id, 0 as nf_plan_id,content_47.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_47 WHERE state_id='8' AND (content_47.category_id='49007' OR content_47.category_id='48990') 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_5.id, content_5.profileid, content_5.URLid, content_5.address_URLid, content_5.userid, content_5.parentcategory_id, content_5.category_id, content_5.company, content_5.address, content_5.city, content_5.zip, content_5.state, content_5.county, content_5.phone, content_5.rating, content_5.owner_name, content_5.plan_id, 0 as nf_plan_id,content_5.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_5 WHERE state_id='8' AND (content_5.category_id='56547') 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_41.id, content_41.profileid, content_41.URLid, content_41.address_URLid, content_41.userid, content_41.parentcategory_id, content_41.category_id, content_41.company, content_41.address, content_41.city, content_41.zip, content_41.state, content_41.county, content_41.phone, content_41.rating, content_41.owner_name, content_41.plan_id, 0 as nf_plan_id,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 WHERE state_id='8' AND (content_41.category_id='56891' OR content_41.category_id='48919') 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='52706' OR content_25.category_id='51590') 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