The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. November 21, 2008, 05:45:24 PM

Login with username, password and session length


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

Posts: 5142


:sniffle: Humor was so much easier before.


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

If I can't be Mr. Root then I don't want to play.
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!