Hey
Jeg har lidt problemer med at få trukket nogen værdier ud fra min database.
Jeg
$values = "1,2,3";
<select multiple id="select1" size="10" style="width:100%">
<?php
$result1 = mysql_query("SELECT * FROM ".$prefix_db."producers WHERE producer_id!='$values' ORDER BY producer_name ASC");
while ($select1 = mysql_fetch_array($result1))
{
echo "<option value=\\"".$select1['producer_id']."\\">".$select1['producer_name']."</option>";
}
?>
</select>
</td><td align="center">
<input type='button' style="width:70px;" value='Tilføj >'
onClick="copySelected(this.form.select1,this.form.select2)">
<br>
<input type='button' style="width:70px;" value='< Fjern'
onClick="copySelected(this.form.select2,this.form.select1)">
<?php
$producers = array($row['product_producer']);
foreach($producers as $val){
echo "$val<br>";
}?> </td><td align="center">
<select multiple id="select2" name="product_producer[]" size="10" style="width:100%">
<?php
$result2 = mysql_query("SELECT * FROM ".$prefix_db."producers WHERE producer_id='$values' ORDER BY producer_name ASC");
while ($select2 = mysql_fetch_array($result2))
{
echo "<option value=\\"".$select2['producer_id']."\\">".$select2['producer_name']."</option>";
}
?>
</select>
Jeg er lidt i tvivl om disse linier kan lade sige gøre:
$result1 = mysql_query("SELECT * FROM ".$prefix_db."producers WHERE producer_id!='$values' ORDER BY producer_name ASC");
&
$result2 = mysql_query("SELECT * FROM ".$prefix_db."producers WHERE producer_id='$values' ORDER BY producer_name ASC");
Håber nogen kan hjælpe