News:

Wondering if this will always be free?  See why free is better.

Main Menu

how to echo a query

Started by irfanjutt63, December 07, 2016, 05:19:37 AM

Previous topic - Next topic

irfanjutt63

i want to echo this query on browser not its result  ...how can i see on browser
$messages_request = $smcFunc['db_query']('', '
         SELECT pm.id_pm, pm.subject, pm.id_member_from, pm.body, pm.msgtime, pm.from_name
         FROM {db_prefix}personal_messages AS pm' . ($context['folder'] == 'sent' ? '
            LEFT JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm)' : '') . ($context['sort_by'] == 'name' ? '
            LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:id_member})' : '') . '
         WHERE pm.id_pm IN ({array_int:display_pms})' . ($context['folder'] == 'sent' ? '
         GROUP BY pm.id_pm, pm.subject, pm.id_member_from, pm.body, pm.msgtime, pm.from_name' : '') . '
         ORDER BY ' . ($context['display_mode'] == 2 ? 'pm.id_pm' : $_GET['sort']) . ($descending ? ' DESC' : ' ASC') . '
         LIMIT ' . count($display_pms),
         array(
            'display_pms' => $display_pms,
            'id_member' => $context['folder'] == 'sent' ? 'pmr.id_member' : 'pm.id_member_from',
         )
      );

TemplateJuggler

Copy the whole statement, but replace db_query with db_quote and remove the first '' from the parameters.
So the first line of the new statement will look like that:

$q = $smcFunc['db_quote']('

Then you can display it with echo($q).

irfanjutt63

oh thans a lot dear....its  works for me...

Advertisement: