User:Emanuele/sandbox/smcFunc

db_query
Current structure: Usage $smcFunc['db_query'] (identifier, query, values, connection) Example $result = $smcFunc['db_query'](''', '               SELECT poster_time                FROM {db_prefix}messages                WHERE id_msg = {int:id_msg}                LIMIT 1',                array( 'id_msg' =&gt; $user_settings['id_msg_last_visit'], )           );
 * Works Similar to how db_query worked in 1.x versions.
 * Identifier is used for identifying specific queries that will be handled specially.
 * Values is an array of values you are intending to use in the query.

Proposed structure: SELECT poster_time FROM {db_prefix}messages WHERE id_msg = {int:id_msg} LIMIT 1', array(                   'id_msg' =&gt; $user_settings['id_msg_last_visit'],                ) );
 * Usage - $smcFunc['db_query'] (identifier, query, values, connection)
 * Description - Works Similar to how db_query worked in 1.x versions.
 * Parameters:
 * identifier - is used for identifying specific queries that will be handled specially.
 * query - is the actual query
 * values - array of values...etc. (optional if no values used in the query)
 * connection - database connection (optional)
 * Example - $result = $smcFunc['db_query'](''', '
 * Return - a query resource or false on error.

or the same without list (except for parameters, that should always be a list)

Attempting a template: