php - fetch data based on another table -
i have table users , table zebra friend list. want t fetch details of friends connected particular user
here code using. not working.
$user_friend_pro_query= "select * users user_id in (select zebra_id zebra user_id='$uid');"; $user_friend_pro_fetch = $conn->query($user_friend_pro_query); while($friend_pro_rows = $user_friend_pro_fetch->fetch_assoc()) { $friend_id=$friend_pro_rows['user_id']; $user_avatar_thumb=$friend_pro_rows['user_avatar_thumb']; ?><li> <a href="memeber-profile.php?user_id=<?php echo $friend_id ?>"> <img src="<?php echo $user_avatar_thumb ; ?>" width="42" height="42"></a></li>
please help
can try change code segment
(select zebra_id zebra user_id='$uid');";
to
(select zebra_id zebra user_id='".$uid."')";
this escape $uid variable, might cause problem.
Comments
Post a Comment