0

According to: https://adodb.org/dokuwiki/doku.php?id=v5:userguide:portable_sql#prepare_execute

$stmt = $db->prepare("SELECT * FROM customers WHERE custid=? AND state=?");
$rs = $db->execute($stmt, array(999,'New York'));

How does one preview the SQL that ADOdb prepares without Executing, first? Namely:

"SELECT * FROM customers WHERE custid=999 AND state='New York'"
Ben Coffin
  • 483
  • 4
  • 13
  • Semi-answered, here: https://stackoverflow.com/questions/7772815/a-way-to-see-query-after-parameters-are-applied (but not for ADOdb). – Ben Coffin Oct 23 '19 at 18:29

1 Answers1

0

This class provides a solution:

https://github.com/jasny/dbquery-mysql/blob/master/src/Jasny/DB/MySQL/QuerySplitter.php

$stmt = "SELECT * FROM customers WHERE custid=? AND state=?";
$params = array(999,'New York');

$split = new QuerySplitter;
$query = $split->bind($stmt , $params);
die($query);

//SELECT * FROM customers WHERE custid=99 AND state='New York'
Ben Coffin
  • 483
  • 4
  • 13