What am I doing wrong with this query?

Here's my query:

$bruce = "select registration.id, 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.

Thoughts?
brucegustPHP DeveloperAsked:
Who is Participating?
 
lwadwellCommented:
You have no "FROM tablename"  presumably "FROM dbo_radio_stations"
0
 
Ray PaseurCommented:
I think lwadwell is on the beam.  ... FROM registration, dbo_radio_stations INNER JOIN...
0
 
lwadwellCommented:
Well, actually ... FROM dbo_radio_stations INNER JOIN registration ON ...
0
 
Ray PaseurCommented:
Yeah, I go with that!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.