Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SHOW SQL

Status
Not open for further replies.

jgeddes

Programmer
Aug 3, 2001
18
US
Is it possible to SHOW the SQL statement on the web page for troubleshooting?

I use a package on the IBM AS/400 that allows me to see the select statement so I can debug.

Can PHP do something like that?

Thanks

John
 
You can assign your SQL to a variable.

$q = "SELECT COUNT(DISTINCT(zip_code)) FROM my_table";

echo $q;

if($debug) {
echo $q;
}

$r = @mysql_query($q) or die(mysql_error());

:) Chad ICQ: 54380631
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top