Newbie having array display probs
Posted: Sat Oct 19, 2002 2:29 pm
Hi there,
Sorry for the dumb question, but im new to PHP and just cant figure this out . I am trying to create a "roster" type layout but cant get my array items to display the way I wish.
DB schema
rank_id | rank1 | rank2 | rank3
1 | user1 | user2 | user3
2 | user1b |
Idea being that I can display each rank and its users with only one query and array, unfortunatly when I try to pull two or more fields PHP is printing out the rows in succession casuing "user1b" to be inserted AFTER the entire first row has been displayed.
$row = mysql_fetch_array($result);
print $row["rank1"];
print $row["rank2"];
will print
user1, user2, user1b
when I'd like
user1, user1b, user2
(i realize this example is oversimplified)
Is my db flawed? Can i use another function to diplay multi-col only w/o re-query? Am i just a newbie moron?
Thanks for the time,
Eric C
Sorry for the dumb question, but im new to PHP and just cant figure this out . I am trying to create a "roster" type layout but cant get my array items to display the way I wish.
DB schema
rank_id | rank1 | rank2 | rank3
1 | user1 | user2 | user3
2 | user1b |
Idea being that I can display each rank and its users with only one query and array, unfortunatly when I try to pull two or more fields PHP is printing out the rows in succession casuing "user1b" to be inserted AFTER the entire first row has been displayed.
$row = mysql_fetch_array($result);
print $row["rank1"];
print $row["rank2"];
will print
user1, user2, user1b
when I'd like
user1, user1b, user2
(i realize this example is oversimplified)
Is my db flawed? Can i use another function to diplay multi-col only w/o re-query? Am i just a newbie moron?
Thanks for the time,
Eric C