retriving the name form the databse only once

Thread Solved

Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

retriving the name form the databse only once

 
0
  #1
Dec 25th, 2005
hi
i ahve a mysql databse in which list of name is stored. i wnate to retrive the data form that databse. i have problem in retriving it. if i have name jack 3 times in my databse, but when i wnat to show the names i get jack jack jack 3 times . i wanted to show only once if they have stored as many as times . ls anybody help me?
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 51
Reputation: tristan17 is an unknown quantity at this point 
Solved Threads: 1
tristan17 tristan17 is offline Offline
Junior Poster in Training

Re: retriving the name form the databse only once

 
0
  #2
Dec 26th, 2005
Originally Posted by aarya
hi
i ahve a mysql databse in which list of name is stored. i wnate to retrive the data form that databse. i have problem in retriving it. if i have name jack 3 times in my databse, but when i wnat to show the names i get jack jack jack 3 times . i wanted to show only once if they have stored as many as times . ls anybody help me?
hi,
maybe you can try the sql:

"SELECT DISTINCT FROM $table....."
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

Re: retriving the name form the databse only once

 
0
  #3
Dec 26th, 2005
Thanks For Your HelP It Worked Thank U Very Much
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 29
Reputation: rcasinillo_s is an unknown quantity at this point 
Solved Threads: 0
rcasinillo_s rcasinillo_s is offline Offline
Light Poster

Re: retriving the name form the databse only once

 
0
  #4
Jan 16th, 2006
Your question is not clear... but
try this:

$query="SELECT * FROM table_name";
$result=mysql_query($result, $link);

while ($i++ < mysql_num_rows($result) && $rs = mysql_fetch_array($result)){
$retrieved[$i] = $rs['name_field_inthe_table'];//It will fetch all rows under the field name you specified.
print("$retrieved[$i]");//print("$retrieved[1]"), print("$retrieved[2]") etc. It will print row 1 for print("$retrieved[1]"), row 2 print("$retrieved[2]"), and so on.
}

I hope it would give you an idea to solve your problem.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC