Use PHP to link to user profile

ejdddiaaiehbb

New Member
I want my php query to display the user name with a link to the user profile.\[code\]<?php$get_items = "SELECT * FROM items WHERE category='test'";$result = mysql_query($get_items);while($item = mysql_fetch_array($result, MYSQL_ASSOC)){ $creator = $item['created_by']; echo "<b>Seller: </b>"."<a href='http://stackoverflow.com/questions/3688212/userprof.php?id=$creator'>$creator</a>"; }?>\[/code\]Clicking on this link takes it to a user profile page that I created. But I want "userprof.php?id=$creator" to know which user to display the account information. Is this the best way to do this? How can I read the url and display the correct information?
 
Back
Top