[Solved] Unable to query two tables in mysql [closed]
[ad_1] You can make something like this: $postID = 1;//Post id we want to get from the database $getPost = $connection->query(“SELECT * FROM posts WHERE post_id=’$postID'”);//Get the post by the id $post = $getPost->fetch_assoc();//Fetch the result to an array $getUser = $connection->query(“SELECT username FROM users WHERE user_id=”.$post[‘id’]);//Get the username by using the id we got … Read more