Pentiums Posted November 10, 2008 Report Share Posted November 10, 2008 ir SELECT * FROM vestules_inbox LEFT JOIN lietotaji ON vestules_inbox.no=lietotaji.id WHERE vestules_inbox.kam = '$lietotaja_id' ORDER BY vestules_inbox.id DESC vajadzīgs izvadīt vēstules id, bet viņš izvada lietotāja id Link to comment Share on other sites More sharing options...
Aleksejs Posted November 10, 2008 Report Share Posted November 10, 2008 tabulu lietotaji un vestules_inbox struktūras "в студию"! Link to comment Share on other sites More sharing options...
Pentiums Posted November 10, 2008 Author Report Share Posted November 10, 2008 (edited) vestules: id|no|kam|datums|teksts|tiripiri... lietotaji: id|lietotajs|md5|tiripiri.... varbūt vēstulēm id lauku vajag pārsaukt par piemēram "vid"? jo abās tabulās tie ir vienādi Edited November 10, 2008 by Pentiums Link to comment Share on other sites More sharing options...
v3rb0 Posted November 10, 2008 Report Share Posted November 10, 2008 Aleksejs, varbūt tomēr ņemsi 1000 rubļus? :] Link to comment Share on other sites More sharing options...
andrisp Posted November 10, 2008 Report Share Posted November 10, 2008 99%, ka `id` lauks no lietotaji "pārraksta" (php mysql modulis nevar atgriezt divas vienādas kolonas) `id` lauku no vestules_inbox. Tas tāpēc, ka selektēts tiek ar zvaigznīgi. Link to comment Share on other sites More sharing options...
Pentiums Posted November 10, 2008 Author Report Share Posted November 10, 2008 ja es selektēšu lietotaji.id un vestules_inbox.id tad viss aizies? Link to comment Share on other sites More sharing options...
andrisp Posted November 10, 2008 Report Share Posted November 10, 2008 Tā gluži ne. Selektē konkrētus laukus, kurus tev vajadzēs. Piem., ja vestules tev ir galvenā tabula, tad: SELECT vestules.*, lietotajs.id as lietotaja_id, lietotajs.name as lietotaja_vards utt Link to comment Share on other sites More sharing options...
Pentiums Posted November 10, 2008 Author Report Share Posted November 10, 2008 Nu paldies Andri :))))) aliņš no manis, gribēju jau arī ar tiem as'iem paprovēt, tik nez kapēc neizprovēju :)) Link to comment Share on other sites More sharing options...
marrtins Posted November 10, 2008 Report Share Posted November 10, 2008 Aliņu vsķudio! Link to comment Share on other sites More sharing options...
Recommended Posts