query('select fullname, birthdate, country_code from person') ->fetch_all(MYSQLI_ASSOC); // echo format_html_table($person_list, 'persontable'); ?> /* */ // direkte Formatierung der Daten mit php in html
%s, %s, %s \n", $person['fullname'], $person['birthdate'], $person['country_code'] ); } ?>
Oder die Trennung von Präsentation und Datengenerierung php, liefert JSON list-persons-ajax.php query('select fullname, birthdate, country_code from person') ->fetch_all(MYSQLI_ASSOC); header('Content-type: application/json'); echo json_encode($person_list); welches dann mit jquery get abgefragt und danach formatiert angezeigt wird