first commit
This commit is contained in:
36
Test/fetch.php
Executable file
36
Test/fetch.php
Executable file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
$connect = mysqli_connect("localhost", "root", "", "bpm");
|
||||
$output = '';
|
||||
if(isset($_POST["query"]))
|
||||
{
|
||||
$search = mysqli_real_escape_string($connect, $_POST["query"]);
|
||||
$query = "
|
||||
SELECT ka_id, vorname, nachname
|
||||
FROM bpm_kandidat
|
||||
WHERE vorname LIKE '%".$search."%'
|
||||
OR nachname LIKE '%".$search."%'
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = "
|
||||
SELECT ka_id, vorname, nachname
|
||||
FROM bpm_kandidat
|
||||
ORDER BY nachname, vorname";
|
||||
}
|
||||
$result = mysqli_query($connect, $query);
|
||||
if(mysqli_num_rows($result) > 0)
|
||||
{
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
$output .= "
|
||||
<option value='$row[ka_id]'>$row[nachname], $row[vorname]</option>
|
||||
";
|
||||
}
|
||||
echo $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Data Not Found';
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user