Search
Left Quote    I think there is a world market for maybe five computers.
- Thomas Watson, Chairman of IBM 1943    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Listing All Users Needed
  This user is offline  Genius
  Subject: "Listing All Users Needed" Posted: @ 1:27 am on Apr 26 2008   

Member #: 582
Rank: User - (77)
Since: 02/18/08
Posts: 76
From: kmmk

I need a script that will list everyone from the db. Mine doesn't work right... it shows the last user only.

Thanks.


    Viewed: 6,367 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Listing All Users Needed" Posted: @ 5:49 pm on Apr 27 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

This should get you started:
Code:


$q = mysql_query(&q uot;SELECT `username` FROM `members` ORDER BY `id` DESC"); if(!$q) die(mysql_error ());

while($show = mysql_fetch_obj ect($q)) {
echo($show-> username);
}




-bs0d | AllSyntax.com

    Viewed: 6,347 Times | Reply to This | To top
  This user is offline  Genius
  Subject: "re: Listing All Users Needed" Posted: @ 9:32 pm on May 08 2008    

Member #: 582
Rank: User - (77)
Since: 02/18/08
Posts: 76
From: kmmk

I changed my code to yours, bs0d, but still... it was showing only the last person. Anyway, I played with HTML for a while which fixed the error. Thanks.




    Viewed: 6,245 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Listing All Users Needed" Posted: @ 10:33 pm on May 08 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

HTML fixed the error? Thats kind of odd. At least you got it working!




-bs0d | AllSyntax.com

    Viewed: 6,240 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank