[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 532
  • Last Modified:

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?
0
brucegust
Asked:
brucegust
  • 2
  • 2
2 Solutions
 
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

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now