 <?php
require 'db.php';

$sqltran = mysqli_query($con, "SELECT vorname fname, nachname lname, mail FROM jumi_admin union SELECT nachname fname, mail lname, mail FROM jumi_admin union SELECT nachname fname, vorname lname, mail FROM jumi_admin ") or die(mysqli_error($con));
$arrVal = array();

$i = 1;
while ($rowList = mysqli_fetch_array($sqltran)) {
    
    $name = array(
        'num' => $i,
        'first' => $rowList['fname'],
        'last' => $rowList['lname'],
        'mail' => $rowList['mail']
    );
    
    
    array_push($arrVal, $name);
    $i++;
}
echo json_encode($arrVal);


mysqli_close($con);
?>  
  