PDA

View Full Version : Question about Debug Mode


afullcup
08-12-2006, 01:24 AM
I'm sure this is going to sound stupid, but here goes...

After I turn on debug mode (as described here (https://vborg.vbsupport.ru/showthread.php?t=82835)), WHERE do I see the debug messages?

I have written a rather large piece of code to include template and php and when I try to load the page, all I get is this:

There seems to have been a problem with the A Full Cup database.
Please try again by clicking the Refresh button in your web browser.

An E-Mail has been dispatched to our Technical Staff, whom you can also contact if the problem persists.

We apologise for any inconvenience.

I can strip it down to bare bones and it loads fine, but SOMETHING in my code is wrong (obviously) and I don't know how to figure out where! help :)

Code Monkey
08-12-2006, 01:40 AM
At the bottom of the page.

Oh, I see. Debug mode isn't going to help with database errors. Yoy need to post some code so we can see what is wrong.

Paul M
08-12-2006, 02:16 AM
You need to post the actual SQL error message, which should be visible to admins running the page, should also be e-mailed to you (or you can right click on the error page and view source).

afullcup
08-12-2006, 02:24 AM
well, I got past that database error above, but now I have another database/code issue... Here's my code segment...

$query_string = "SELECT rebate_id, product, rebate_type, max_value, exp_date
FROM " . TABLE_PREFIX . "rebate
$query_sort
LIMIT $limitlower, " . $viewrebates['perpage'] . "";

echo "query: $query_string";

$rebate_list = $vbulletin->db->query_first($query_string);

while ($rebate = $vbulletin->db->fetch_array($rebate_list))
{
echo "in while <BR>";
echo $rebate[product];
echo $rebate[rebate_type];
}


The query_string is fine - I can run the resulting query on my database directly and get rows back. However, I never get "in while". Am I fetching the array wrong?

answered my own question, sorry.... had query_first instead of query_read. it's late, what can i say. :)

thanks ya'll. :)

Paul M
08-12-2006, 02:28 AM
You don't need "$vbulletin->db->query_first", instead use "$vbulletin->db->query_read".