@@ -126,7 +126,11 @@ private function compileForSelect(Builder $builder, $bindings) {
126126 for ($ ind = 0 ; $ ind < count ($ wheres ); $ ind ++ ){
127127 if (isset ($ wheres [$ ind ]['value ' ])){
128128 if (in_array (strtolower ($ tipos [$ wheres [$ ind ]['column ' ]]), $ this ->without_quotes )){
129- $ new_binds [$ i ] = $ bindings [$ i ]/1 ;
129+ if (!is_null ($ bindings [$ i ])){
130+ $ new_binds [$ i ] = $ bindings [$ i ]/1 ;
131+ }else {
132+ $ new_binds [$ i ] = null ;
133+ }
130134 }else {
131135 $ new_binds [$ i ] = (string )$ bindings [$ i ];
132136 }
@@ -227,7 +231,11 @@ private function compileBindings($query, $bindings)
227231 if (count ($ bindings )>$ ind ){
228232 array_push ($ new_format [$ table ], ['campo ' => $ campos , 'binding ' => $ ind ]);
229233 if (in_array (strtolower ($ types [$ table ][$ campos ]['type ' ]), $ this ->without_quotes )){
230- $ new_binds [$ ind ] = $ bindings [$ ind ]/1 ;
234+ if (!is_null ($ bindings [$ i ])){
235+ $ new_binds [$ i ] = $ bindings [$ i ]/1 ;
236+ }else {
237+ $ new_binds [$ i ] = null ;
238+ }
231239 }else {
232240 $ new_binds [$ ind ] = (string )$ bindings [$ ind ];
233241 }
@@ -262,7 +270,12 @@ private function compileNewQuery($query, $bindings)
262270 $ bindings [$ i ] = str_replace ( "' " , "'' " , $ bindings [$ i ] );
263271 $ newQuery .= "' " .$ bindings [$ i ]."' " ;
264272 }else {
265- $ newQuery .= $ bindings [$ i ];
273+ if (!is_null ($ bindings [$ i ])){
274+ $ newQuery .= $ bindings [$ i ];
275+ }else {
276+ $ newQuery .= 'null ' ;
277+ }
278+
266279 }
267280 }
268281 }
@@ -358,4 +371,4 @@ public function affectingStatement($query, $bindings = array())
358371 return $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ))->rowCount ();
359372 });
360373 }
361- }
374+ }
0 commit comments