  |
53 | 53 | | |
| |
54 | 54 | | function numberOfEntries() { |
| |
55 | 55 | | global $osC_Database, $osC_Customer; |
  |
56 | | - | static $total_entries = 0; |
| |
| 56 | + | static $total_entries; |
|
57 | 57 | | |
  |
58 | | - | if ($total_entries === 0) { |
| |
| 58 | + | if (is_numeric($total_entries) === false) { |
|
59 | 59 | | $Qaddresses = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id'); |
| |
60 | 60 | | $Qaddresses->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
| |
61 | 61 | | $Qaddresses->bindInt(':customers_id', $osC_Customer->id); |
| |
62 | 62 | | $Qaddresses->execute(); |
| |
63 | 63 | | |
| |
64 | 64 | | $total_entries = $Qaddresses->valueInt('total'); |
  |
| 65 | + | } else { |
| |
| 66 | + | $total_entries = 0; |
  |
65 | 67 | | } |
| |
66 | 68 | | |
| |
67 | 69 | | return $total_entries; |