What am I doing wrong with this query?

Posted on 2012-09-01
Last Modified: 2012-09-03
Here's my query:

$bruce = "select, registration.winner_type, registration.radio_name, registration.year, dbo_radio_stations.station_name, dbo_radio_stations.state as radio_state inner join registration on dbo_radio_stations.station_name= registration.radio_name where registration.winner_type='State' and registration.year='$this_year' order by dbo_radio_stations.state";

I keep getting told:

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 'inner join registration on dbo_radio_stations.station_name= registration.radio_n' at line 1  
 ...and I don't know what I'm doing wrong.

Question by:brucegust
    LVL 25

    Accepted Solution

    You have no "FROM tablename"  presumably "FROM dbo_radio_stations"
    LVL 107

    Assisted Solution

    by:Ray Paseur
    I think lwadwell is on the beam.  ... FROM registration, dbo_radio_stations INNER JOIN...
    LVL 25

    Expert Comment

    Well, actually ... FROM dbo_radio_stations INNER JOIN registration ON ...
    LVL 107

    Expert Comment

    by:Ray Paseur
    Yeah, I go with that!

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now