man5 Posted April 2, 2014 Share Posted April 2, 2014 So I have a user profile setup where it's linked unique username using $_GET session. That all works. Now here's a bit that I didn't think of. I can't display the same profile that I view to other users; because then the content on the profile page would be relavent to the person logged in. For eg. $get_username = $_GET['user']; if($username === $get_username) { $stmt = $dbh->prepare("SELECT * FROM users WHERE user_id = $userid"); //display user's profile to himself only. } else { //display user's profile to everyone else } My set is like that. The problem with that is, I can't get the same content to show on the the profile that's viewed by other users; because I'm using current logged in user's id to get records from mysql db. Link to comment https://forums.phpfreaks.com/topic/287474-this-is-interesting-displaying-users-profile-to-other-users/ Share on other sites More sharing options...
man5 Posted April 2, 2014 Author Share Posted April 2, 2014 Well I have located the problem. The way my queries are setup are that they retrive data by using current user's id and not username. So I switched to userid for the get user's profile. All good now. Link to comment https://forums.phpfreaks.com/topic/287474-this-is-interesting-displaying-users-profile-to-other-users/#findComment-1474737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.