Struktura tabeli:
date id_from fg_from id_to fg_to amount comment
1207861591 1 16.00 2 16.00 1.00 test
Z takiego przykładu pobierane dane.
Pobieram równień members_display_name i on dotyczy JOIN'ów z pól "id_from" i "id_to" :-)
<?php 'select' => 'mf.members_display_name', 'where' => 'mf.id = fg.id_from', 'type' => 'left' ), 'select' => 'mt.members_display_name', 'where' => 'mt.id = fg.id_to', 'type' => 'left' ) ), 'where' => 'id_from = '.$this->ipsclass->member['id'].' OR id_to = '.$this->ipsclass->member['id'], 'order' => 'date '.$order, ?>
Problem? Pobieram dobrze wszystkie dane, oprócz nazwy id_from. Pobiera dobre ID ( 1 ), ale zwraca wynik jak dla ID = 2. W czym leży problem?
PS. Podaje zapytanie MySQL bardziej czytelne:
SELECT fg.*,mf.members_display_name,mt.members_display_name FROM ibf_fg_logs fg LEFT JOIN ibf_members mf ON ( mf.id = fg.id_from ) LEFT JOIN ibf_members mt ON ( mt.id = fg.id_to ) WHERE id_from=1 OR id_to=1 ORDER BY date DESC LIMIT 0, 10
Pozdrawiam,
Largo
PS. Nie ma chętnych do pomocy?