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. Quote Link to comment Share on other sites More sharing options...
Solution man5 Posted April 2, 2014 Author Solution 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.