@@ -150,7 +150,12 @@ private function compileBindings($query, $bindings)
150150
151151 switch (explode (' ' , $ query )[0 ]){
152152 case "select " :
153- return $ this ->compileForSelect ($ this ->queryGrammar ->getBuilder (), $ bindings );
153+ $ builder = $ this ->queryGrammar ->getBuilder ();
154+ if ($ builder != NULL && $ builder ->wheres != NULL ){
155+ return $ this ->compileForSelect ($ builder , $ bindings );
156+ }else {
157+ return $ bindings ;
158+ }
154159 case "insert " :
155160 preg_match ("/(?'tables'.*) \((?'attributes'.*)\) values/i " ,$ query , $ matches );
156161 break ;
@@ -264,9 +269,15 @@ public function select($query, $bindings = array(), $useReadPdo = true)
264269 return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings ) use ($ useReadPdo )
265270 {
266271 if ($ me ->pretending ()) return array ();
267- $ offset = $ this ->queryGrammar ->getBuilder ()->offset ;
268- $ limit = $ this ->queryGrammar ->getBuilder ()->limit ;
269- $ from = explode (" " , $ this ->queryGrammar ->getBuilder ()->from )[0 ];
272+
273+ if ($ this ->queryGrammar ->getBuilder () != NULL ){
274+
275+ $ offset = $ this ->queryGrammar ->getBuilder ()->offset ;
276+ $ limit = $ this ->queryGrammar ->getBuilder ()->limit ;
277+ $ from = explode (" " , $ this ->queryGrammar ->getBuilder ()->from )[0 ];
278+ }else {
279+ $ offset = 0 ;
280+ }
270281 if ($ offset >0 ){
271282 if (!isset ($ limit )){
272283 $ limit = 999999999999999999999999999 ;
0 commit comments