Hi all,
3 tables :
one events table (each event can have differents types)
one types table (each type can have differents events)
and
one liaison table (link between events and types tables)
I have some problems when I show screen.
<select name="type[]" size="10" multiple="multiple">
<?php
$req_type = "SELECT * FROM type ORDER BY type ASC";
$res_type = mysql_query($req_type);
$req_liaison = "SELECT * FROM liaison WHERE id_ev = $id";
$res_liaison = mysql_query($req_liaison);
$ligne_liaison = mysql_fetch_array($res_liaison);
while ($ligne_type = mysql_fetch_array($res_type))
{
?>
<option value="<?php echo $ligne_type['id'] ?>" <?php if (isset($ligne_liaison) && in_array($ligne_type['id'], $ligne_liaison)) { echo 'selected="selected"'; } ?>><?php echo $ligne_type['type'] ?></option>
<?php
}
?>
</select>
The selected don't run and don't show correct value.
Can you help me ?
Thanks a lots