Fixing $count problem with query debug

Because we now foreach through an array of sql, rather than concat'ing it all together for multi_query(), the $count variable needs to sit outside the foreach.

Also, we were still imploding the sql, even though we never used it. (Worse, we were overwriting it with the foreach loop variable)

Also decided not to use local $mysql variable for shorter lines. Meh, snap decision...