anevins Posted March 12, 2011 Share Posted March 12, 2011 This select statement works fine: SELECT make, colour, street, town, city, date FROM location, stick, report WHERE report.rid = stick.sid AND stick.missingLocation = location.lid But I want to add another table, this select statement breaks: SELECT make, colour, street, town, city, date, image_url, image_width, image_height FROM location, stick, report, identification WHERE report.rid = stick.sid AND stick.missingLocation = location.lid AND identification.stickID = stick.sid Structure for table 'identification': |------ |Field|Type|Null|Default |------ |//**id**//|int(11)|No| |image_url|char(220)|No| |image_width|char(220)|No| |image_height|char(220)|No| |image_type|enum('jpeg', 'pjpeg', 'png', 'gif')|No| |stickID|int(11)|Yes|NULL Quote Link to comment https://forums.phpfreaks.com/topic/230419-select-is-breaking-somewhere/ Share on other sites More sharing options...
fenway Posted March 13, 2011 Share Posted March 13, 2011 If by "breaking" you mean "no results", then you need LEFT JOIN, not commas. Quote Link to comment https://forums.phpfreaks.com/topic/230419-select-is-breaking-somewhere/#findComment-1186838 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.