1.

Solve : MySQL , PHP Database (for forums) wont work?

Answer»

All it does is display 1 thread.
Heres the database:

>forums > topics
>> forum_title
>> forum_id
>> forum_section
>> forum_views
>> forum_replies
>> forum_creator
>> forum_sticky

But for some reason, when theres already something in the database, it doesnt post it.
Heres what I think it is

> forums > topics
> forum_sticky (2 rows of 0)


But heres the code:


Code: [Select]for($x=1;$x<=$rn;$x++) {
require "Database/connect.php";
$q = mysql_query("SELECT * FROM topics WHERE forum_id='$x'");
while($q = mysql_fetch_array($q)) {
if($q['forum_sticky'] == "0") {
if($q['forum_section'] == $_GET['ID']) {
echo "
<tr style='background-color:#D4E4F4;'>
<td><span style=\"height:15px;WIDTH:100%;font-weight:bold;font:12px/1.2 Tahoma, Verdana, Arial;padding:3px;margin:4px;font-weight:bold;\">".$q['forum_title']."</span></td>
<td><span style=\"height:15px;width:100%;font-weight:bold;font:12px/1.2 Tahoma, Verdana, Arial;padding:3px;margin:4px;font-weight:bold;\">".$q['forum_creator']."</span></td>
<td><span style=\"height:15px;width:100%;font-weight:bold;font:12px/1.2 Tahoma, Verdana, Arial;padding:3px;margin:4px;font-weight:bold;\">".$q['forum_replies']."</span></td>
<td><span style=\"height:15px;width:100%;font-weight:bold;font:12px/1.2 Tahoma, Verdana, Arial;padding:3px;margin:4px;font-weight:bold;\">".$q['forum_views']."</span></td>
</tr>";
}
}
}
}
Just fixed width problems....I HONESTLY have no idea what you're asking.You're not creating your own forum, are you?

Quote

require "Database/connect.php";
That probably won't work, depending on the server config.

Try this:

Code: [Select]require(dirname(__FILE__) . "/Database/connect.php");Yes, I made my own forums. And I just used math to do this one.
And guess what? I built it in a week.. SADLY, I didn't have sql injection protection, and it was injected

But, I do now Quote
Sadly, I didn't have sql injection protection, and it was injected
By who?

And, and if you're really SERIOUS about this site, I'd recommend removing the item on the front page "Free domain name", since you don't actually offer a free domain name.


Discussion

No Comment Found