haster (viser hvid side)
Jeg har lavet det script.. men det viser bare en hvis side... en der kan finde min fejl?<? include ("db.php") ; ?>
<?
if (! isset($ID))
{
$ID = '1';
}
if (isset ($edit))
{
if ($edit == 'changed')
{
mysql_query("UPDATE tower SET forside='$forside2', rum='$rum2', mail='$mail2', crew='$crew2', avis='$avis2' WHERE id ='$ID'");
$query2 = mysql_query("SELECT forside, rum, mail, crew, avis FROM tower WHERE id = '$ID' ");
$data2 = mysql_fetch_array($query2);
echo "<h3>Data ændret !!!</h3><br>Nye Data: <br><br>";
echo "forside: <b>$data2[0]</b><br><br> ";
echo "rum: <b>$data2[1]</b><br><br>";
echo "mail: <b>$data2[2]</b><br><br>";
echo "crew: <b>$data2[4]</b><br><br>";
echo "og avis: <b>$data2[5]</b><br><br>";
}
else
{
$query1 = mysql_query("SELECT forside, rum, mail, crew, avis FROM tower WHERE id = '$ID' ");
$data1 = mysql_fetch_array($query1); ?>
<html><head><title>Ændre Data</title></head>
<body bgcolor="#FFFFFF">
<form method="POST" action="numse.php?edit=changed&brugernavn=<?=$brugernavn?>&password=<?=$password?>">
forside: <input type="text" name="forside2" value="<?php echo"$data1[0]"; ?>"><br><br>
rum: <input type="text" name="rum2" value="<?php echo "$data1[1]"; ?>"><br><br>
mail: <input type="text" name="mail2" value="<?php echo "$data1[2]"; ?>"><br><br>
crew: <input type="text" name="crew2" value="<?php echo "$data1[3]"; ?>"><br><br>
avis: <input type="text" name="avis2" value="<?php echo "$data1[4]"; ?>"><br><br>
<input type="submit" name=submit" value="Ændre Data">
</form></body></html> <?php
}
}
}
else
{
$query1 = mysql_query("SELECT forside, rum, mail, crew, avis FROM tower WHERE id = '$ID' ");
while ($data = mysql_fetch_array($query)) { ?>
<html><head><title>Ændre Data</title></head>
<body bgcolor="#FFFFFF">
<form method="POST" action="numse.php?edit=changed&brugernavn=<?=$brugernavn?>&password=<?=$password?>">
forside: <input type="text" name="forside2" value="<?php echo"$data1[0]"; ?>"><br><br>
rum: <input type="text" name="rum2" value="<?php echo "$data1[1]"; ?>"><br><br>
mail: <input type="text" name="mail2" value="<?php echo "$data1[2]"; ?>"><br><br>
crew: <input type="text" name="crew2" value="<?php echo "$data1[3]"; ?>"><br><br>
avis: <input type="text" name="avis2" value="<?php echo "$data1[4]"; ?>"><br><br>
<input type="submit" name=submit" value="Ændre Data">
</form></body></html>
<? } } ?>