0

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?

3
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by rcasinillo_s
0

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....."

0

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;//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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.