0

I am working on some old code using ADODB in PHP. Queries look like this:

$query = "SELECT `foo`                                                                                                                                                                
          FROM `bar`;                                                                                                                                           
$result = $conn->Execute( $query );

I am adding some AJAX functionality to the software but I realised that the Execute function is echoing/printing out the query - I don't want this:

(mysqlt): SELECT `foo`                                                                                                                                                                
           FROM `bar`   

I believe mysqlt is the MySQL driver.

Is there a way to stop this output ?

Many thanks.

4

1 回答 1

0

Try disabling debugging.

$query = "SELECT `foo` FROM `bar`";
$conn->Debug = false;
$conn->Execute($query);

Otherwise, try using output buffering:

ob_start();
$query = "SELECT `foo` FROM `bar`";
$conn->Execute($query);
ob_end_clean();
于 2012-09-20T14:32:36.377 回答