Ok I have a profile page which have this on it
$sql="select * from friend_acc_setting where user_id='$_GET[userid]'";
$result_privacy=executequery($sql);
so I would be able to use on this page $line_privacy[ROWNAMEHERE]
later on in the page there is a call to this function though which call the same table again, is there a way I could cut this down to 1 DB call and use something like $line_privacy[ROWNAMEHERE] for the function below?
function checkshowgrouponprofile($userid){
// according to privacy setting
$gsonprofile_arr_id1="1".",";
$gsonprofile_arr_id2=","."1".",";
$gsonprofile_arr_id3=","."1";
$gsonprofile_arr_id4="1";
$privacy="select * from friend_acc_setting where (profile_settings like '$gsonprofile_arr_id1%' or profile_settings like '%$gsonprofile_arr_id2%' or profile_settings like '%$gsonprofile_arr_id3' or profile_settings='$gsonprofile_arr_id4') and user_id='$userid'";
$result_privacy=executequery($privacy);
if(mysql_num_rows($result_privacy) > 0 )
return true;
else
return false;
}
when I echo
<?
echo $line_privacy[profile_settings];
?>
I get
1,3,4,5