mirror of
https://github.com/FlyInTheBox/31TSAI.git
synced 2025-01-06 12:34:37 +01:00
24 lines
626 B
PHP
24 lines
626 B
PHP
<?php $sql_dept = "SELECT id FROM dept;";
|
|
$wyn_dept = mysqli_query($id_conn, $sql_dept);
|
|
if (mysqli_error($id_conn)) {
|
|
echo "Błąd w zapytaniu o stanowiska: " . $baza . '(' . mysqli_error($id_conn) .')';
|
|
mysqli_close($id_conn);
|
|
exit;
|
|
}
|
|
|
|
$ok_dept = 0;
|
|
$depts = '';
|
|
$dept = '';
|
|
while($w_dept=mysqli_fetch_array($wyn_dept)) {
|
|
if ($w_dept['id'] == $dept) {
|
|
$ok_dept = 1;
|
|
}
|
|
$depts = $depts . ', <br> -' . $w_dept['id'];
|
|
}
|
|
|
|
if($ok_dept == 0) {
|
|
echo 'Nie ma departamentu "' .$dept . '", wybierz jedno z poniższych: ';
|
|
echo '<br>' . substr($depts, 6);
|
|
mysqli_close($id_conn);
|
|
exit;
|
|
}
|