adwfun Posted September 13, 2006 Share Posted September 13, 2006 I have 2 tables named City and District in MySQL. Table City fields : CityID, CityNameTable District fields : DistrictID, DistrictName, CityIDI linked District to City. When retrieving data from District Table, how could I display CityName instead of cityID ?My codes as follow: What's problem ?<?phpinclude("connectdb.php");$district=mysql_query("select * from District");while ($result=mysql_fetch_array($district)){echo $result["DistrictID"]."<br>";echo $result["Districtname"]."<br>";echo $result["select Districtname, Cityname from District, City where City.CityID=District.CityID"]."<br>";}?> Quote Link to comment Share on other sites More sharing options...
fenway Posted September 13, 2006 Share Posted September 13, 2006 You're not actually issuing that query. 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.