<?php
elseif($a == 'Show' and $w == 'Topic' and $id != '')
{
$id2 = $_GET['id'];
$selecttopic = "SELECT * FROM Reactions WHERE id = '$id2' and topic ='1' ";
$querytopic = mysql_query($selecttopic) or die(mysql_error());
$doestopicexist = mysql_num_rows($querytopic);
if($doestopicexist == '0'){echo"No Topic found with id no. :$id2<br><a href=\"javascript:history.back()\">« Go back</a><table border='0' cellpadding='0' cellspacing='0'>";}else{
while ($topiclist = mysql_fetch_object($querytopic)) {
//bla bla bla
}//end query
}//end else
}//ende topic
?>
?
Onbekende gebruiker
03-04-2006 20:18
@Thomas
Foei foei, variabelen moeten buiten de quotes.
Verder is een veel gebruikte opbouw van een forum als volgt:
mysql:
tabel topics:
ID
username
email
bericht
datum
tabel reactions:
ID
topicid ( dat is dus het topic waar dit een reactie op is)
username
email
bericht
email