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>";}?> Link to comment https://forums.phpfreaks.com/topic/20593-displaying-data-from-linked-tables/ Share on other sites More sharing options...
fenway Posted September 13, 2006 Share Posted September 13, 2006 You're not actually issuing that query. Link to comment https://forums.phpfreaks.com/topic/20593-displaying-data-from-linked-tables/#findComment-91100 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.