lJesterl Posted November 12, 2007 Share Posted November 12, 2007 Im working on a little project simliar to myspace profiles. I have it set where they can set there profile private or not. When set to private the isprivate value is 1 and when its not private the isprivate value is 0. Here is the code I am using to check if the profile is private. $checkprivate=mysql_query("SELECT * FROM private WHERE playerid='$playerid'"); $chkp=mysql_fetch_array($checkprivate); if($chkp[isprivate] == "1"){ include("functions/error2.php"); display_error("Sorry but this user has there profile set to private.","messagecenter.php"); } Everything works fine as far as if the profile is private it will bring up the error page and if it isnt private it will not. But what I need to do is find out how to ignore that if that person is my friend. For example I have a friends table friend1 friend2 I need to do something where i $blah = select friend1 from friends where friend2=$plyr[alias] (plyr[alias] is the cooke information if im logged in) then i need something like if $blah ignore $checkprivate hope u guys can understand its a little hard to explain Link to comment https://forums.phpfreaks.com/topic/76933-help-with-something-php/ Share on other sites More sharing options...
teng84 Posted November 12, 2007 Share Posted November 12, 2007 you have ti have a one two many relationship wherein your id will relates their id then your condition in your query will look something like this select * from table1 inner join table2 on yourID = theirID Link to comment https://forums.phpfreaks.com/topic/76933-help-with-something-php/#findComment-389529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.