これが私のコードです:
<?php
$con = mysqli_connect("127.0.0.1:3306","root","root","photoshare");
$query = "SELECT ID,nickname,photoLikes FROM tbl_photo";
$result = mysqli_query($con,$query);
$query_dislike = "SELECT nickname, idGivenLike FROM tbl_check_like";
$resultDislike = mysqli_query($con,$query_dislike);
$photoIDdislike;
$photoID;
while($photoID = mysqli_fetch_assoc ($result) || $photoIDdislike = mysqli_fetch_assoc($resultDislike) )
{
//checks if both of results
if($result["ID"] != $resultDislike["idGivenLike"])
{
echo "true";
}
}
?>
実行すると、次の行が表示されます
if($result["ID"] != $resultDislike["idGivenLike"])
h 致命的なエラーの場合: Fatal error: Cannot use object of type mysqli_result as array
なぜ機能しないのですか?どうすれば修正できますか?