[INDENT][/INDENT]Hello,
Im doing a project which is basically making a forum using PHP,HTML and MYSQL database. I basically using a PHP script to import data into the MySQL database and another PHP script to show all the data in the MySQL table on brower. So in a nut shell im using a combination of these two script to simulate a forum.
Ive got the these working which are:
login
create a new thread
display all the threads
create a new post
display all the posts
however the problem I have is that all posts data from the MySQL table is showing in every single thread, these should happenI only want the posts to show in the threads they corresspond to, I taught it would do this automatically because did all the primary and foreign stuff with my three MySQL tables which are users,threads,posts bellow is the coding for my posts script and MySQL cmd.
This is the MySQL tables that I made:
[ATTACH]4767[/ATTACH]
This is the HTML and PHP codinf for the posts process to display the posts:
<!-- Link to CSS-->
<link rel="stylesheet" type="text/css" href= "CSS/default.css" title="Main">
<p>
Welcome to the posts Page!!!!!!!!!
</p>
To start a new post fill in the details and...
<form name "input" action="new_post.php" method="post"></p>
<input type="text" name="thread_ID" size="25" value="Input thread ID here"><br>
<input type="text" name="description" size="25" value="Description"><br>
<input type="text" name="date" size="25" value="Post Date"><br>
<p><input type="submit" value="Submit"></p>
</form>
<form name "input" action="threads.php" method="post"></p>
<p><input type="submit" value="Back"></p>
</form>
<p>Click the "Submit" button to create a post.</p>
<?php
$mysqli = mysqli_connect("localhost", "root","","forum");
$myquery = "select * from posts";
$result = mysqli_query($mysqli,$myquery);
echo "<table>";
while($record = mysqli_fetch_array($result,MYSQL_ASSOC))
{
$sky = $record["postID"];
$ground = $record["thread_ID"];
$water = $record["description"];
$air = $record["date"];
echo "<tr>";
echo "<td>";
echo $sky;
echo "</td>";
echo "<td>";