|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
viewing data problem
i have two tables as below:
table USER( id char(10) name char(20) email char(20) country char(20) ); table COUNTRY( country_id char(20), country_name char(20) ); the country_id is store into the USER table as it selected so next, i want to view my data, <? mysql_connect("localhost", "root"); @mysql_select_db("user") ; $result = mysql_query("select * from user"); $row = mysql_fetch_array($result); ?> echo "Name: ".$myrow["name"]; echo "email: ".$myrow["email"]; echo "country: ".$myrow["country"]; that's the problem, it show the country_id not the country_name, so how i query from them to view the country field is country name |
|
#2
|
|||||
|
|||||
|
RE: viewing data problem
Change the code on the mysql_query line to something like :
php Code:
It's probably a good idea to change the user.country and country.country_id fields to be integers.. faster lookup. Hope this helps |
|
#3
|
|||
|
|||
|
RE: viewing data problem
ha..ha...thanks CmdrDats ur help.....it worked now....thanks
|
|
#4
|
|||
|
|||
|
RE: viewing data problem
only a pleasure to be of assistance ;)
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > viewing data problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|