I’m getting below error when I view the index page of my petitions controller. This has been just baked…I’m not sure what this means although I suspect that this is related to table name not being plural in SQL as the table name is Petitions adhering to cake’s naming conventions… Any ideas guys?
SELECT `Petition`.`random_string`, `Petition`.`diary_number`, `Petition`.`group`, `Petition`.`created`, `Petition`.`modified`, `Petition`.`petitioner_type`, `Petition`.`signed`, `Petition`.`project_desc`, `Petition`.`amount_suggested`, `Petition`.`amount_accepted`, `Petition`.`project_type`, `Petition`.`project_decision`, `Petition`.`evaluation`, `Petition`.`admin_comments`, `Petition`.`commentator_comments`, `Petition`.`q1_petitioner`, `Petition`.`q1_partners`, `Petition`.`q1_regcode`, `Petition`.`q1_responsible`, `Petition`.`q1_position`, `Petition`.`q1_address`, `Petition`.`q1_zipcode`, `Petition`.`q1_city`, `Petition`.`q1_phone`, `Petition`.`q1_gsm`, `Petition`.`q1_email`, `Petition`.`q2_project_name`, `Petition`.`q2_target_group`, `Petition`.`q2_project_goal`, `Petition`.`q2_newones`, `Petition`.`q2_newgroups`, `Petition`.`q2_organizers`, `Petition`.`q2_donations`, `Petition`.`q2_type`, `Petition`.`q3_amount`, `Petition`.`q3_purpose`, `Petition`.`q3_account_number`, `Petition`.`q3_receiver`, `Petition`.`q4_sports`, `Petition`.`q4_participates`, `Petition`.`q4_places`, `Petition`.`q4_schedule`, `Petition`.`q4_marketing`, `Petition`.`q4_directors`, `Petition`.`q4_monitoring`, `Petition`.`q4_support`, `Petition`.`q4_collaboration`, `Petition`.`q5_costs`, `Petition`.`q5_costs_desc`, `Petition`.`q5_income`, `Petition`.`q5_income_desc`, `Petition`.`q5_invisible`, `Petition`.`s1_question1`, `Petition`.`s1_question2`, `Petition`.`s1_question3`, `Petition`.`s1_question4`, `Petition`.`s1_question5`, s1_question., `Petition`.`s2_question1`, `Petition`.`s2_question2`, `Petition`.`s2_question_3`, `Petition`.`s3_question1`, s3_question2., `Petition`.`s4_question1`, `Petition`.`s4_question2`, `Petition`.`s5_question1`, s5_question2. FROM `petitions` AS `Petition` WHERE 1 = 1 LIMIT 20 1064: 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 ' `Petition`.`s2_question1`, `Petition`.`s2_question2`, `Petition`.`s2_question_3' at line 1 0
Well, yes, if the table name is Petitions then SQL code that attempts to select values from a table named Petition, is not going to work. My understanding of Cakephp conventions is that it wants all tables to be be lowercase, so perhaps this is throwing off its inflector? See: http://book.cakephp.org/view/1478/Inflector.