I'm making a forum from scratch and I'm really confused.
I have the boards and when you click in the boards it goes to the threads. But whatever the board ID is it will go to the same ID in threads.php
It will not show all the threads in the board. You have to do "viewthreads.php?id=(Whatever) and it'll go to it unlike a normal forum.
Here's my code I made
Viewthread.php
<?php require_once("config.php");
$id = $_GET['id'];
$name = $_GET['name'];
$result = mysql_query("SELECT * FROM threads WHERE `id`='$id'") or die(mysql_error());
echo " <table border='1' 'width = 30%' > ";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<hr>";
echo "<b>Username:</b> "; echo ''.$row['name'];
echo "<hr>";
}
?>
Addthread.php
<?php include("config.php");
$name = $_POST['name'];
mysql_query("INSERT INTO threads
(name) VALUES('$name' ) ")
or die(mysql_error()); ?>
Please help thanks 🙂