Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] problem z zapytaniem sql
blackroger
post
Post #1





Grupa: Zarejestrowani
Postów: 176
Pomógł: 0
Dołączył: 8.11.2008

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


Mam tabele user w schema i w bazie Postgree. W momencie:
  1. $c = new Criteria();
  2. $c->add(UserPeer::LOGIN, $login);
  3. $c->add(UserPeer::PASS, md5($pass));
  4. $c->add(UserPeer::DELETED, false);
  5. $u = UserPeer::doSelectOne($c);

pojawia się błąd

500 | Internal Server Error | PropelException
<h2 id="message"> [wrapped: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "."
LINE 1: SELECT user.USER_ID, user.LOGIN, user.PASS, user.NAME, user....
^]
</h2>wygląda na to że user jest zarezerwowany. Normalnie w statycznym zapytaniu do bazy np. select name from "user", user daje w cudzysłowie. Jak to obejść?

Zamieniłem wszystkie const w BaseUserPeer np.:
const USER_ID = 'user.USER_ID';

na
const USER_ID = '"user".USER_ID';

Da się jakoś w schemie już to ustawić?

np. <table name=""user"" phpName="User">, gdzie user jest interpretowany w cudzysłowie?
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 21.08.2025 - 16:08