The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 19, 2019, 02:19:15 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: DB / SQL Debugging Tip  (Read 2433 times)
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« on: May 16, 2007, 12:48:43 AM »

Put this line:

$GLOBALS['debug_last_sql'] = $db_string;

at line 240 of /Sources/Subs.php - then anywhere in the code where SMF uses the db_query() function, immediately after it you can say print "{$GLOBALS['debug_last_sql'])
" and see what was just thrown at the database. Vurrah handy because they often create the SQL in the function call itself, and pulling it out so that you can see it is a pain.

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!