PHP-Code:
<?
/* showthreads.php */
$con = mysql_connect('localhost', 'praktikant', 'praktikant');
$db = mysql_select_db('praktikant');
$res = mysql_query("select * from threads where fid=".$_GET["fid"]);
while($row = mysql_fetch_array($res)) or die mysql_error()
{
echo "<a href=\"showanswers.php?fid=".$row["fid"]."&tid=".$row["id"]."\">";
echo $row["topic"]."</a><br>";
}
echo "<a href=\"newthread.php?fid=".$row["fid"]."&tid=".$row["id"]."\">Neuer Thread</a>";
?>
<?
/*newthread.php*/
echo '<form action="newthread_script.php" method="post" name="newthread">';
echo 'Name:<input name="name" type="text" size="20" maxlength="20">';
echo 'Topic:<input name="topic" type="text" size="20" maxlength="20"><br><br>';
echo 'Message:<input name="nachricht" type="text" size="50" maxlength="500">';
echo '<input type="hidden" name="id" value="<? echo $_GET["id"]; ?>';
echo '<input name="Abschiken" type="submit" value="Submit">';
echo '</form>';
?>
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /pool/www.praktikant.de/www/forum/showthreads.php on line 14
Kommentar