num_rows !== 0) { while ($row = mysqli_fetch_object($result)) { $registration = (object) [ 'rid' => $row->rid, 'firstname' => $row->firstname, 'lastname' => $row->lastname, 'birthday' => $row->birthday, 'gender' => $row->gender, 'street' => $row->street, 'house' => $row->house, 'zip' => $row->zip, 'city' => $row->city, 'phone' => $row->phone, 'email' => $row->email, 'accountholder' => $row->accountholder, 'iban' => $row->iban, 'bic' => $row->bic, 'bank' => $row->bank, 'applicationconsent' => $row->applicationconsent, 'datachangeconsent' => $row->datachangeconsent, 'privacypolicyconsent' => $row->privacypolicyconsent, 'directdebitconsent' => $row->directdebitconsent, 'returndebitconsent' => $row->returndebitconsent, 'datastorageconsent' => $row->datastorageconsent, 'multimediaconsent' => $row->multimediaconsent, 'registrationfrom' => $row->registrationfrom ]; array_push($returnValue, $registration); } } mysqli_free_result($result); echo json_encode($returnValue); ?>