Viewing the value of a Variable

Started by JimSelleck, November 21, 2007, 11:12:51 PM

Previous topic - Next topic

JimSelleck

I'm a programmer by profession, but I am finding learning the inner workings of SMF to be extremely difficult and a very slow process.  To tell the truth, I have mastered several other major technologies and used them in my work daily during the time that I have been trying to figure out SMF structure and methodology, and at times I feel like I am no closer to understanding how SMF works now than I was 2 years ago.

Of course, the total lack of technical specification docs really slows down the learning process.  It seems that reverse engineering is the only way to learn how to mod and change SMF, but I'm not having much success even there.

For example, I would like to see what some of the finished SQL queries look like.  To do that, I go into the PHP code after SQL has been placed into a variable called $request, and insert something like:

echo $request;

Well... of course THAT doesn't work.  All I get is an obscure reference on the screen like:

Resource id #19

What the hell does THAT mean?????

Is there any way to use ECHO statements to dump SQL from the PHP???  If so, HOW?  If not, is there some kind of monitoring utility for MySQL that will show a log of queries as they are processed?

codenaught

Well if you add:

$db_show_debug  = true;

To Settings.php, you can view each query that is run at the bottom of each page of SMF.
Dev Consultant
Former SMF Doc Coordinator

JimSelleck

Wow!  THAT is an incredibly useful tidbit of information.  You MAY have just saved the day for me.

THANKS!!

Advertisement: