Просмотр исходного кода

fix typo's + bugs to see customer info MVC v1

customers
Ramdan Katakpawou 2 лет назад
Родитель
Сommit
3e08305c45
1 измененных файлов: 3 добавлений и 4 удалений
  1. 3
    4
      src/DB/CustomersDB.php

+ 3
- 4
src/DB/CustomersDB.php Просмотреть файл

@@ -16,9 +16,7 @@ class CustomersDB extends DB {
}

public function loadCust(){
$stmt= $this->container->get('webshop.db')->prepare("SELECT * FROM clients");
$res = $stmt->execute();

$stmt= $this->container->get('db')->prepare("SELECT * FROM clients");
$stmt ->bindValue(':id',SQLITE3_TEXT);
$stmt ->bindValue(':firstname', SQLITE3_TEXT);
$stmt ->bindValue(':lastname', SQLITE3_TEXT);
@@ -30,6 +28,7 @@ class CustomersDB extends DB {
$stmt ->bindValue(':city', SQLITE3_TEXT);
$stmt ->bindValue(':state', SQLITE3_TEXT);
$stmt ->bindValue(':country', SQLITE3_TEXT);
$res = $stmt->execute();

while($result = $res->fetchArray(SQLITE3_ASSOC)){
$customer = new Customers($this->container);
@@ -46,6 +45,6 @@ class CustomersDB extends DB {
$customer->setCountry($result['country']);
$this->customers[] = $customer;
}
return $res;
return $this->customers;
}
}

Загрузка…
Отмена
Сохранить