Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] Problem z insertem
masterix
post
Post #1





Grupa: Zarejestrowani
Postów: 93
Pomógł: 0
Dołączył: 7.09.2004

Ostrzeżenie: (0%)
-----


Witam,

Mam taki fragment w schema.yml:
Cytat
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:
Cytat
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:
  1. 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.

Ten post edytował masterix 20.11.2009, 19:32:55
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 16:03