File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -330,15 +330,28 @@ public function on_error($error_callback) {
330
330
}
331
331
}
332
332
333
+ public function get_query () {
334
+ $ info = $ this ->get_info ();
335
+ $ query = $ info ['statement ' ];
336
+
337
+ if (!empty ($ info ['bind ' ])) {
338
+ foreach ($ info ['bind ' ] as $ field => $ value ) {
339
+ $ query = str_replace (': ' .$ field , $ this ->quote ($ value ), $ query );
340
+ }
341
+ }
342
+
343
+ return $ query ;
344
+ }
345
+
333
346
public function get_info () {
334
347
$ info = [];
335
348
336
349
if (!empty ($ this ->_sql )) {
337
- $ info ['SQL ' ] = $ this ->_sql ;
350
+ $ info ['statement ' ] = $ this ->_sql ;
338
351
}
339
352
340
353
if (!empty ($ this ->_bind )) {
341
- $ info ['Bind ' ] = $ this ->_bind ;
354
+ $ info ['bind ' ] = $ this ->_bind ;
342
355
}
343
356
344
357
return $ info ;
@@ -494,4 +507,4 @@ private function cleanup($bind = '') {
494
507
495
508
return $ bind ;
496
509
}
497
- }
510
+ }
You can’t perform that action at this time.
0 commit comments