Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require '../Objekte/Kunde.inc.php';
- class DBKundenTool{
- function __construct(){
- }
- function getCustomerList(){
- $db=new mysqli("localhost","root","","kundendb");
- //var_dump($db);
- $query="SELECT * FROM tblKunde";
- $result=$db->query($query);
- $kundenListe=array();
- while ($row=$result->fetch_object()) {
- $kundenListe[]=new Kunde($row->Anrede, $row->Vorname, $row->Nachname);
- }
- $db->close();
- return $kundenListe;
- }
- }
- $dbKunden=new DBKundenTool();
- $liste=$dbKunden->getCustomerList();
- var_dump($liste);
- for ($i=0;$i < count($liste);$i++) {
- echo $liste[$i]->nachname;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement