Sunday, December 12, 2010

Print query in Drupal 7 or Display query in drupal7

<?php

$querystring = db_select('table1')
->fields('table1')
->execute()
->getQueryString();
echo $querystring;

Or

$querystring = db_select('table1')
->fields('table1');
echo $querystring;

?>

No comments:

Post a Comment