php - Doctrine sql query, where clause not taken into account -
i suppose problem simple can't fixed...
here query:
$this->invites = doctrine_query::create() ->from('utilisateur u') ->leftjoin('u.invites on i.utilisateur_id = u.id') ->where('u.invites.invitation_id=', $this->invitation->getid()) ->execute();
and here schema:
invites: columns: invitation_id: {type: integer, notnull: true } utilisateur_id: {type: integer, notnull: true } relations: utilisateur: {ondelete: cascade, local: utilisateur_id, foreign: id} invitation: {ondelete: cascade, local: invitation_id, foreign: id, class: invitation, refclass: invites} utilisateur: actas: { timestampable: ~ } columns: email: {type: string(255), notnull: true } password: {type: string(255), notnull: true } facebook: {type: integer(11), notnull: true } smartphone: {type: string(128), notnull: true } prenom: {type: string(255), notnull: true } nom: {type: string(255), notnull: true } daten: {type: timestamp, notnull: true } sexe: {type: boolean, notnull: true, default: 0} date: {type: timestamp, notnull: true }
it seems "where" clause in not taking account. if invitation_id 3 still have "invite" showing invitation_id = 1
can me ?
thank you
edit solved ! needed add ? after equal sign in clause :
->where('u.invites.invitation_id=?', $this->invitation->getid())
$this->invites = doctrine_query::create() ->from('utilisateur u') ->leftjoin('u.invites on i.utilisateur_id = u.id') ->where('u.invites.invitation_id = ?', $this->invitation->getid()) ->execute();
Comments
Post a Comment