@@ -103,7 +103,7 @@ private function UseDB(){
103103
104104
105105 // Performs a 'mysql_real_escape_string' on the entire array/string
106- private function SecureData ($ data , $ types ){
106+ private function SecureData ($ data , $ types= array () ){
107107 if (is_array ($ data )){
108108 $ i = 0 ;
109109 foreach ($ data as $ key =>$ val ){
@@ -166,7 +166,6 @@ private function CleanData($data, $type = ''){
166166 $ data = filter_var ($ data , FILTER_VALIDATE_EMAIL );
167167 break ;
168168 default :
169- $ data = '' ;
170169 break ;
171170 }
172171 return $ data ;
@@ -216,7 +215,7 @@ public function setCharset( $charset = 'UTF8' ) {
216215 }
217216
218217 // Adds a record to the database based on the array key names
219- public function insert ($ table , $ vars , $ exclude = '' , $ datatypes ){
218+ public function insert ($ table , $ vars , $ exclude = '' , $ datatypes= array () ){
220219
221220 // Catch Exclusions
222221 if ($ exclude == '' ){
@@ -242,7 +241,7 @@ public function insert($table, $vars, $exclude = '', $datatypes){
242241 }
243242
244243 // Deletes a record from the database
245- public function delete ($ table , $ where ='' , $ limit ='' , $ like =false , $ wheretypes ){
244+ public function delete ($ table , $ where ='' , $ limit ='' , $ like =false , $ wheretypes= array () ){
246245 $ query = "DELETE FROM ` {$ table }` WHERE " ;
247246 if (is_array ($ where ) && $ where != '' ){
248247 // Prepare Variables
@@ -268,7 +267,7 @@ public function delete($table, $where='', $limit='', $like=false, $wheretypes){
268267
269268
270269 // Gets a single row from $from where $where is true
271- public function select ($ from , $ where ='' , $ orderBy ='' , $ limit ='' , $ like =false , $ operand ='AND ' ,$ cols ='* ' , $ wheretypes ){
270+ public function select ($ from , $ where ='' , $ orderBy ='' , $ limit ='' , $ like =false , $ operand ='AND ' ,$ cols ='* ' , $ wheretypes= array () ){
272271 // Catch Exceptions
273272 if (trim ($ from ) == '' ){
274273 return false ;
@@ -302,12 +301,14 @@ public function select($from, $where='', $orderBy='', $limit='', $like=false, $o
302301 $ query .= ' LIMIT ' . $ limit ;
303302 }
304303
305- return $ this ->executeSQL ($ query );
304+ $ result = $ this ->executeSQL ($ query );
305+ if (is_array ($ result )) return $ result ;
306+ return array ();
306307
307308 }
308309
309310 // Updates a record in the database based on WHERE
310- public function update ($ table , $ set , $ where , $ exclude = '' , $ datatypes , $ wheretypes ){
311+ public function update ($ table , $ set , $ where , $ exclude = '' , $ datatypes= array () , $ wheretypes= array () ){
311312 // Catch Exceptions
312313 if (trim ($ table ) == '' || !is_array ($ set ) || !is_array ($ where )){
313314 return false ;
0 commit comments