@@ -73,13 +73,14 @@ private static function getInstance()
7373 self ::useConnection ($ connectionName
7474 }
7575 try  {
76-  $ instancenew  PDO ('mysql:host= '  . self ::$ connectionsself ::$ connectionName'HOST ' ] . ";dbname= "  . self ::$ connectionsself ::$ connectionName'NAME ' ] . ";charset=utf8;  " , self ::$ connectionsself ::$ connectionName'USER ' ], self ::$ connectionsself ::$ connectionName'PASSWORD ' ]);
76+  $ instancenew  PDO ('mysql:host= '  . self ::$ connectionsself ::$ connectionName'HOST ' ] . ";dbname= "  . self ::$ connectionsself ::$ connectionName'NAME ' ] . "; " , self ::$ connectionsself ::$ connectionName'USER ' ], self ::$ connectionsself ::$ connectionName'PASSWORD ' ]);
7777 if  ($ instance
7878 $ instancesetAttribute (PDO ::ATTR_EMULATE_PREPARES , false );
7979 //$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
8080 self ::updateTotalRequests ();
8181 return  $ instance
8282 } else  {
83+  exit ("There's been an error within the database " );
8384 return  false ;
8485 }
8586 } catch  (Exception $ exception
@@ -186,7 +187,15 @@ public static function fetchAll($mixed)
186187 /** It counts the total rows that $mixed have */ 
187188 public  static  function  count ($ mixed
188189 {
189-  return  self ::encapsulate ($ mixedextra ['totalEntries ' ];
190+  if  ($ mixednull ) {
191+  return  0 ;
192+  } else  {
193+  if  (is_array ($ mixed
194+  return  1 ;
195+  } else  {
196+  return  self ::encapsulate ($ mixedextra ['totalEntries ' ];
197+  }
198+  }
190199 }
191200
192201 /** Checks if the given $query returns null. If it returns null or 0, the function return true (is empty) */ 
@@ -198,7 +207,7 @@ public static function empty($query)
198207 if  ($ queryinstanceof  dbObject) {
199208 return  ($ querygetInstance ()->rowCount () == 1 );
200209 }
201-  if (is_bool ($ query
210+  if (is_bool ($ query
202211 return  !$ query
203212 }
204213 }
0 commit comments