Ok. Now i am getting seriously stressed !!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
User avatar
ericburnard
Forum Contributor
Posts: 104
Joined: Wed Jun 15, 2005 5:11 pm
Location: Chesterfield, UK

Ok. Now i am getting seriously stressed !!!

Post by ericburnard »

HELP PLEASE !!!! i am going crazy over this.

All i want to do is show users details from my database on my page after they have logged in. people have given me links or snippets of code that go in one side of my head and out of the other.

please if anybody could give me a scipt that dosnt need much editing i would be ever so greatfull.

thanks

eric
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you want someone to do it for you, or you want help doing it?

I'm happy to offer the latter:

use a url var to determine the id of the user about whom you want the information:

Code: Select all

<a href=&quote;http://www.yoursite.com/yourpage.php?userid=55&quote;>check user 55's stuff</a>
then query the db for that user's info and loop over all of the fields in the table:

Code: Select all

$result = mysql_query(&quote;select * from user where id = &quote;.$_GETї'userid'])
   or die(mysql_error());
while($row =  mysql_fetch_assoc($result)){
  echo $rowї'col1'].&quote;<br>&quote;.$rowї'col2'].&quote;<br>&quote;.$rowї'col3']; // etc
}
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

DO NOT CROSS POST.
Original Thread: viewtopic.php?p=184053&highlight=#184053
Topic Locked.
Locked