Jump to:

10929 Posts in 2613 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Multiform book example: SQL error on saving related data

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 717 Views
  • Gerard Mengerink
    Avatar
    Community Member
    3 Posts

    Multiform book example: SQL error on saving related data Link to this post

    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

  • Gerard Mengerink
    Avatar
    Community Member
    3 Posts

    Re: Multiform book example: SQL error on saving related data Link to this post

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

    Gerard

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Multiform book example: SQL error on saving related data Link to this post

    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';

    717 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.