Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Multiform book example: SQL error on saving related data


Go to End


3 Posts   1175 Views

Avatar
Gerard Mengerink

Community Member, 3 Posts

22 November 2010 at 3:14am

I'm getting following error on saving Skills in the book example of chapter 6.

Couldn't run query: SELECT "Skill"."ClassName", "Skill"."Created", "Skill"."LastEdited", "Skill"."Title", "Skill"."ID", CASE WHEN "Skill"."ClassName" IS NOT NULL THEN "Skill"."ClassName" ELSE 'Skill' END AS "RecordClassName" FROM "Skill" WHERE (`Skill`.`Title` = "HTML") LIMIT 1 Unknown column 'HTML' in 'where clause'
Line 526 of MySQLDatabase.php

If I copy this in SQLYog and execute, it says the same. After changing double quotes into single qoutes (" in to ') it works all right.

Gerard

Avatar
Gerard Mengerink

Community Member, 3 Posts

22 November 2010 at 3:22am

Problem SOLVED. I used the book code version. Latest version works all right.

Gerard

Avatar
Ingo

Forum Moderator, 801 Posts

16 December 2010 at 10:15pm

Hey Gerard, you have to ensure any SQL connection you're making (including SQLYog) is running in "ANSI" mode (main difference: double quotes rather than backticks). You can do this on a query by query level as well: SET sql_mode = 'ANSI';