Przemysław
Szczerbicki
Programista,
freelancer
Temat: Problem z insertem
Witam,Mam taki fragment w schema.yml:
order:
id: ~
user_id: { type: integer, foreignTable: sf_guard_user, foreignReference: id, required: true }
company_id: { type: integer, required: true, foreignTable: sf_guard_user, foreignReference: id }
W wygenerowanym formularzu nie mogę dodać niestety żadnego nowego obiektu tego typu. Dostaję taki błąd:
Unable to execute INSERT statement. [wrapped: SQLSTATE[42000]: Syntax error or access violation: 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 'order (`ID`,`USER_ID`,`COMPANY_ID`) VALUES (NULL,6,9)' at line 1]
Kolumna ID faktycznie jest w bazie jako auto increment, pola istnieją i nie wiem co jest źle
Używam Propela i symfony 1.2
Zauwazyłem, że MySQL tego zapytania też nie przyjmuje, natomaist sam generuje takie:
INSERT INTO `order` (`id`, `user_id`, `company_id`) VALUES (NULL, '4', '2');
Skąd te cudzysłowy dla liczb? Pola user_id i company_id są typu int.
pzdr.