Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6369339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:47:34+00:00 2026-05-25T00:47:34+00:00

I have been reading this query now for about 20 minutes and I cannot

  • 0

I have been reading this query now for about 20 minutes and I cannot see what is wrong with it.

SELECT   SQL_CALC_FOUND_ROWS addressbook_people.first_name,
         addressbook_people.last_name                     ,
         addressbook_people.preferred_name                ,
         addressbook_companies3.name                      ,
         addressbook_people.url                           ,
         addressbook_groups5.name                         ,
         addressbook_people.telephone1                    ,
         addressbook_people.telephone2                    ,
         addressbook_people.telephone3                    ,
         addressbook_people.email1                        ,
         addressbook_people.email2                        ,
         addressbook_people.fax1                          ,
         addressbook_people.fax2                          ,
         root_countries13.name                            ,
         root_territories14.name                          ,
         root_cities15.name                               ,
         addressbook_people.address1                      ,
         addressbook_people.zip_postal1                   ,
         addressbook_people.po_box                        ,
         root_countries19.name                            ,
         root_territories20.name                          ,
         root_cities21.name                               ,
         addressbook_people.address2                      ,
         addressbook_people.zip_postal2
FROM     addressbook_people
WHERE    (
                  (
                           addressbook_people.first_name     LIKE '%a%'
                  OR       addressbook_people.last_name      LIKE '%a%'
                  OR       addressbook_people.preferred_name LIKE '%a%'
                  OR       addressbook_companies3.name       LIKE '%a%'
                  OR       addressbook_people.url            LIKE '%a%'
                  OR       addressbook_groups5.name          LIKE '%a%'
                  OR       addressbook_people.telephone1     LIKE '%a%'
                  OR       addressbook_people.telephone2     LIKE '%a%'
                  OR       addressbook_people.telephone3     LIKE '%a%'
                  OR       addressbook_people.email1         LIKE '%a%'
                  OR       addressbook_people.email2         LIKE '%a%'
                  OR       addressbook_people.fax1           LIKE '%a%'
                  OR       addressbook_people.fax2           LIKE '%a%'
                  OR       root_countries13.name             LIKE '%a%'
                  OR       root_territories14.name           LIKE '%a%'
                  OR       root_cities15.name                LIKE '%a%'
                  OR       addressbook_people.address1       LIKE '%a%'
                  OR       addressbook_people.zip_postal1    LIKE '%a%'
                  OR       addressbook_people.po_box         LIKE '%a%'
                  OR       root_countries19.name             LIKE '%a%'
                  OR       root_territories20.name           LIKE '%a%'
                  OR       root_cities21.name                LIKE '%a%'
                  OR       addressbook_people.address2       LIKE '%a%'
                  OR       addressbook_people.zip_postal2    LIKE '%a%'
                  )
         )
         LEFT JOIN addressbook_companies AS addressbook_companies3
         ON       addressbook_people.company_id = addressbook_companies3.id
         LEFT JOIN addressbook_groups AS addressbook_groups5
         ON       addressbook_people.group_id = addressbook_groups5.id
         LEFT JOIN root_countries AS root_countries13
         ON       addressbook_people.country1 = root_countries13.id
         LEFT JOIN root_territories AS root_territories14
         ON       addressbook_people.territory1 = root_territories14.id
         LEFT JOIN root_cities AS root_cities15
         ON       addressbook_people.city1 = root_cities15.id
         LEFT JOIN root_countries AS root_countries19
         ON       addressbook_people.country2 = root_countries19.id
         LEFT JOIN root_territories AS root_territories20
         ON       addressbook_people.territory2 = root_territories20.id
         LEFT JOIN root_cities AS root_cities21
         ON       addressbook_people.city2 = root_cities21.id
ORDER BY LTRIM(addressbook_people.url)DESC
LIMIT    0, 10

This is the output of my filter for a data table. So ignore the fact that i’m looking for like ‘a’

I use PHPMyAdmin, when executing the SQL in a Query via the Web Management Console I receive the following error

1064 – You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use
near ‘LEFT JOIN addressbook_companies AS addressbook_companies3 ON
addr’ at line 54

I’ve checked the line, it’s the beginning of my joins. I don’t see a problem.. Can someone please help? I’ve never been any good with SQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:47:34+00:00Added an answer on May 25, 2026 at 12:47 am

    You need to do your JOINs before your WHERE clause

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been altering a query for a while now, reading many posts on
i have been reading this interesting article which is increasing my every growing confusion
I have been reading through this wonderful website regarding the recommended Python IDEs and
I have been reading up on this, and it seems that if you use
I've been reading that if I have something like this: @property (nonatomic, assign) UIView
I have been reading through the C++ FAQ and was curious about the friend
I have been reading about the differences between Table Variables and Temp Tables and
I have been reading articles about state management in ASP.NET for few days for
I've been reading about LINQ to Objects, and now my colleagues want me to
I have been reading about VARCHAR fields being converted to CHAR fields whenever MySQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.