viena tante Posted July 31, 2010 Report Share Posted July 31, 2010 Selektot no 2. tabulas rindu vai atsevišķu ierakstu atkarībā no 1. tabulas konkrēta ieraksta kurš būtu kolonnā:location! Gribētos to izdarīt vienā pieprasijumā, pagaidām tikai mācos 1.tabula id | user | location ------------------------ 1 | ezis | loc.pl.ba1 | 2.tabula id | loc | name | description | ------------------------------------- 1 | loc.pl.ba1 | ceļš | nelīdzens... cerams, ka sapratāt :) Quote Link to comment Share on other sites More sharing options...
briedis Posted July 31, 2010 Report Share Posted July 31, 2010 O, atradu risinājumu! :) http://tinyurl.com/32l7nuk Quote Link to comment Share on other sites More sharing options...
101111 Posted July 31, 2010 Report Share Posted July 31, 2010 Nja, es laikam nesapratu ko tu meegini panaakt.. Quote Link to comment Share on other sites More sharing options...
viena tante Posted July 31, 2010 Author Report Share Posted July 31, 2010 (edited) Lietotāju tabulā ir saglabāts kādā lokācijā viņš atrodas, man vajag lai ielādē ierakstu no lokāciju tabulas par attiecīgo lokāciju, kurā ir gan apraksts, gan arī norādes uz citām lokācijam, kuras ir saistītas ar lokāciju, kur lietotājs šobrīd atrodās. Edited July 31, 2010 by viena tante Quote Link to comment Share on other sites More sharing options...
Code Posted July 31, 2010 Report Share Posted July 31, 2010 Palasi par join... Quote Link to comment Share on other sites More sharing options...
viena tante Posted July 31, 2010 Author Report Share Posted July 31, 2010 (edited) izspiedu kautko šādu SELECT fw_locations.id, fw_locations.loc, fw_locations.saistloc, fw_locations.name FROM fw_locations, fw_users WHERE fw_locations.loc=fw_users.location AND fw_users.username='admin' LIMIT 1; paldies, kas centās palīdzēt, pagaidām mani tas apmierina, problēma ija tur, ka es pat īsti nezināju kurā virzienā meklēt :) Edited July 31, 2010 by viena tante Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.