Jump to content

divinedesigns1
 Share

Recommended Posts

hey sup guys, can someone who me how to combine mysqli tables so it can function correctly what im trying to do is have each person topic be displayed and the comment to be displayed under that topic, and only that topic, but so far i havent found out how to do so. i know how the database need to be set up but, to bring it into coding thats where im lose athow to you get more than one comment to display, so start i can display one comment only, and there are 3 comments in total this is what im doing to get them to display under the topic

<?php    $query = "SELECT * FROM replies INNER JOIN news ON replies.id = news.id";$result = mysqli_query($con, $query);while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){  echo $row['title'];  echo $row['author'];  echo $row['comment'];  echo '<hr width="65%" />';}    ?>

in the query i combine the replies table with the news table, then i match up the id of news and replies which work partly but doesnt display the other 2 comments tips? hint? opinion? anything will do at the moment im totally lost

Edited by DDs1
Link to comment
Share on other sites

test with "outer join" and use var_dump() in while loop and check what does it print.

Link to comment
Share on other sites

test with "outer join" and use var_dump() in while loop and check what does it print.
i got it working but now i cant get the form to display under the new topic i created, this is a little complicated, but its fun figuring it out piece by piece hehehehehe
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...