I'm new at php and I followed this youtube : https://www.youtube.com/watch?v=LQ8DpIbD9Ps in order to build the conversations.php script. I made a littel adjustment's from mysql to mysqli. I don't get the same result as in minute 10:06 of the video. It doesn't display me the conversations list. I can't find where my error is.
<?php
if(isset($_GET['hash']) && !empty($_GET['hash'])){
echo "Show messages!";
}
else {
echo "<b>Select Conversation:</b>";
$sql_k = "select 'hash', 'user_one','user_two' from message_group
where user_one='$my_id' OR user_two='$my_id'";
$get_con = mysqli_query($db,$sql_k);
while ($run_con = mysqli_fetch_array($get_con)){
$hash = $run_con['hash'];
$user_one = $run_con['user_one'];
$user_two = $run_con['user_two'];
if ($user_one==$my_id)
{
$select_id = $user_two;
} else {
$select_id = $user_one;
}
$sqli = "Select 'username' from users where
id='$select_id'";
$user_get = mysqli_query($db,$sqli);
$run_user = mysqli_fetch_array($user_get);
echo $run_user;
$select_username = $run_user['username'];
echo "<p><a href ='conversations.php?hash=$hash'>$select_username</a></p>";
}
}
?>