1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| <select name="<?php "$msg" ?>" class="select">
<?php
$DBhost = "localhost";
$DBuser = "#######";
$DBpass = "#######";
$DBName = "#######";
$_SESSION['msg'] = $msg;
$link = mysql_connect ($DBhost,$DBuser,$DBpass) or die ('Erreur : '.mysql_error() );
mysql_select_db($DBName) or die ('Erreur :'.mysql_error());
$select = "SELECT DISTINCT ID, t_login, subject1, subject2, subject3, subject1level, subject2level, subject3level
FROM teachers_data_media";
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
while($row = mysql_fetch_array($result)) {
if($row['subject1'] !=""){
$t_login = $row['t_login'];
$subject = $row['subject1'];
$level = $row['subject1level'];
$msg = array('t_log' => $t_login, 'subj' => $subject, 'lev' =>$level);
print "<option value=\"$msg\">".$row['subject1']." : ".$row['subject1level']."</option>";
}
if($row['subject2'] != ""){
$t_login = $row['t_login'];
$subject = $row['subject2'];
$level = $row['subject2level'];
$msg = array('t_log' => $t_login, 'subj' => $subject, 'lev' =>$level);
print "<option value=\"$msg\">".$row['subject2']." : ".$row['subject2level']."</option>";
}
if($row['subject3'] != ""){
$t_login = $row['t_login'];
$subject = $row['subject3'];
$level = $row['subject3level'];
$msg = array('t_log' => $t_login, 'subj' => $subject, 'lev' =>$level);
print "<option value=\"$msg\">".$row['subject3']." : ".$row['subject3level']."</option>";
}
}
?>
</select> |
Partager