{if $layout.dberrors}

{t}Error!{/t} {t}Database errors occurred!{/t}
{foreach from=$layout.dberrors item=dberror} {t}Query:{/t} {$dberror.query}
{t}Error:{/t} {$dberror.error}
{/foreach}

{/if}