tags:

views:

139

answers:

1

http://www.neighborrow.com is currently displaying this error:

Warning (512): SQL Error: 1054: Unknown column 'User.rating' in 'order clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 527]

Where's the error in this query?

SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`, `User`.`email`, 
`User`.`password`, `User`.`phone`, `User`.`address`, `User`.`city`, `User`.`zip`, 
`User`.`region`, `User`.`verified`, `User`.`residence_id`, `User`.`rating_id`, 
`User`.`facebook_id`, `Residence`.`id`, `Residence`.`residence` FROM `users` AS `User` 
LEFT JOIN `residences` AS `Residence` ON (`User`.`residence_id` = `Residence`.`id`)  
WHERE `User`.`first_name` IS NOT NULL   ORDER BY `User`.`rating` DESC  LIMIT 5 
+3  A: 

You don't have the column "rating" in your "User" table.

The "error" is at:

User::get_top() - APP/models/user.php, line 134

according to your site, at least that's where it's called from.

Oscar
http://neighborrow.com/ fixed itTHANKS
adam
@adam And a second link to your site was needed because...?
Michael Mrozek
to show it was fixed... is that an issue?:)
adam
not trying to promote an unfinished site by a clearly and admittedly beginner programmer to a group of tutors if that is what you are insinuating:)
adam
@adam Ok. It's common spammer behavior to toss random links at the beginning of their answers/comments, but demonstrating it's fixed makes sense
Michael Mrozek
fair enough- just seems like a lot of work to spam something that even when clicked has no value for the spammer... i may ask a homework question from time to time but i make sure i set an answer for ever question i ask and i absolutely do not spam... thanks for your help SO is a great resource i know you are just trying to keep it that way
adam