Hvad gør jeg galdt her ??
den vil ikke udskrive det hele ?
<?
if($_SESSION['jumbo_OK'] == 1) { ?>
<?
mysql_connect("XXXXX", "XXXXX", "XXXXXX");
mysql_select_db("gb2490");
$result = mysql_query("SELECT * FROM jl_varer where id = '$id' ")
or die (mysql_error());
while($info = mysql_fetch_row($result))
{?>
<table>
<tr>
<td>Vare Navn :</td>
<td><input type="text" value="<? echo($info[1]); ?>" name="varenavn"></td>
<td><? echo($info[1]); ?></td>
</tr>
<tr>
<td>Pris :</td>
<td><input type="text" value="<? echo($info[7]); ?>" name="varenavn"></td>
<td><? echo($info[7]); ?></td>
</tr>
<tr>
<td>
Størelser :
</td>
<td>
<input type="text" value="<? echo($info[9]); ?>" name="varenavn">
<td><? echo($info[9]); ?></td>
</td>
</tr>
<tr>
<td>Aktiv :</td>
<td>
<select name="status3" size="1">
<option value="<? echo($info[8]); ?>" selected>Behold Status</option>
<option value="Ja" >Ja</option>
<option value="Nej">Nej</option>
</select>
</td>
<td><? echo($info[1]); ?></td>
</tr>
<tr>
<td>Vare Gruppe :</td>
<td>
<select name="status2" size="1">
<?
mysql_connect("XXXXX", "XXXXX", "XXXXX");
mysql_select_db("gb2490");
$result = mysql_query("SELECT * FROM jl_varer where type = 's' ")
or die (mysql_error());
while($info = mysql_fetch_row($result))
{?>
<option selected value="<? echo($info[1]); ?>"><? echo($info[1]); ?></option>
<?
}
?>
</select></td>
<td><? echo($info[1]); ?></td>
</tr>
<tr>
<td>Tilbud :</td>
<td>
<select name="tilbud" size="1">
<option value="<? echo($info[13]); ?>" selected>Behold Status</option>
<option value="Ja">Ja</option>
<option value="Nej" >Nej</option>
</select>
</td>
<td><? echo($info[13]); ?></td>
</tr>
<tr>
<td>Vare Billed :</td>
<td>
<select name="billed" size="1">
<option value="<? echo($info[5]); ?>" selected>Behold Status</option>
<?php
$dir = "../pic/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if($file!=="."&&$file!=="..")
echo "<option value='$file'>$file</option>";
}
closedir($dh);
}
}
?>
</select>
</td>
<td><? echo($info[1]); ?></td>
</tr>
<tr>
<td>Status :</td>
<td>
<select name="status" size="1">
<option value="<? echo($info[3]); ?>" selected>Behold Status</option>
<option value="På Lager">På lager</option>
<option value="Udsolgt">Udsolgt</option>
</select>
</td>
<td><? echo($info[3]); ?></td>
</tr>
<tr>
<td>Beskrivelse :</td>
<td>
<textarea name=beskrivelse rows=7 cols=23><? echo($info[2]); ?></textarea>
</td>
<td><? echo($info[2]); ?></td>
</tr>
</table>
<?
}
?>
<?
}else{
echo "[b]Du Har Ikke Adgang Til Denne Side[/b]";
}
?>
//Mark S. Johansen
»»
Hej Mark,
Dit problem er at du bruger de samme variabler til at hente info fra databasen. Det vil sige din første while løkke bruger variablen $result men du bruger den samme variabel når du henter din varegruppe status.
Prøv at ændre din dropdown code til:
<td>Vare Gruppe :</td>
<td>
<select name="status2" size="1">
<?
mysql_connect("XXXXX", "XXXXX", "XXXXX");
mysql_select_db("gb2490");
$db_result = mysql_query("SELECT * FROM jl_varer where type = 's' ") or die (mysql_error());
while($data = mysql_fetch_row($db_result))
{?>
<option selected value="<? echo($data[1]); ?>"><? echo($data[1]); ?></option>
<?
}
?>
</select></td>
/Michael.