Jump to content

how to do a custom query and display results in a template?


rkatz0

Recommended Posts

Hi,

 

Support keeps answering me like it is in the docs or very obvious but I simply do not see it. I want to modify the homepage.tpl in Admin to show the total amount for Unpaid Invoices.

 

Support says I need "a custom {php} code block to select the data from the DB, format and then output for display."

 

The query is elementary which they provided: SELECT SUM(total) FROM tblinvoices WHERE status='Unpaid'

 

I suspect something goes inside {php} {/php} but I do not see any examples of it in the docs. I guess the variable needs to be created and formatted somewhere. Can anyone point to an example or doc about this? I searched "custom {php} code query" but many other things seemed to come up.

 

Thank you in advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated