私が取り組んでいるプロファイル サイトに php を使用しています。プロファイル ID がメンバー ID と等しくないことを確認する必要があります。だから私はこれを持っています:
<?php
$get_personal_sql = "SELECT * FROM members WHERE username = '$thisuser'";
$get_personal_res = mysqli_query($con, $get_personal_sql);
while ($personal = mysqli_fetch_assoc($get_personal_res)){
$yourid = $personal['id'];
$yourtype = $personal['type'];
$yoursubtype = $personal['subtype'];
$yourusername = $personal['username'];
$youremail = $personal['email'];
$yourname = $personal['name'];
$youractive = $personal['active'];
$yourpro = $personal['pro'];
$yourdel = $personal['del'];
$yourdate = $personal['date'];
}
?>
<?php
$get_member_sql = "SELECT * FROM members WHERE username = '$thismember'";
$get_member_res = mysqli_query($con, $get_member_sql);
$count_member = mysqli_num_rows($get_member_res);
if($count_member == 0){
header("Location: notfound.php");
}
while ($member = mysqli_fetch_assoc($get_member_res)){
$memberid = $member['id'];
$membertype = $member['type'];
$membersubtype = $member['subtype'];
$memberusername = $member['username'];
$memberemail = $member['email'];
$membername = $member['name'];
$memberactive = $member['active'];
$memberpro = $member['pro'];
$memberdel = $member['del'];
$memberdate = $member['date'];
}
?>
<?php
if($memberid === $yourid){
$yourprofile = "true";
}
else{
$yourprofile = "false";
}
?>
ページで $memberid と $yourid の両方をエコーしましたが、それらは完全に異なりますが、$yourprofile をエコーすると「true」と表示されます。これがなぜなのか誰にもわかりますか?