PDA

View Full Version : Echo SQL Query


aoneill
11-21-2005, 09:51 PM
Hi Winston,

Is there an easy way to print the SQL query that is being sent to the server? It appears that the query is derived both within index.php and functions.php.

For your info - I'm now using your script successfully (with LIKE queries switched off) on a 270Mb table with 90,000 records. It's returning results in < 0.3 secs.

Many thanks for your help.

Winston
11-23-2005, 10:17 PM
Hi, in tdSearch.php find $numresults = null; and afterwards echo out $sql_query (this doesn't have on the ORDER BY / LIMIT parts of the query). If you want the latter, you'll need to COPY $results = mysql_query("THE STUFF IN HERE",$connect); and set it in its own variable to echo onscreen.