I do not know how to program in PHP, but I am trying to understand how I can set dynamic variables in templates. For example, if I use the query tag, how can I create a few dynamic variables that i can place the value of in a few different areas on the template? I have been looking at low variables and the standard template variables, but don't see how to make them work dynamically. Can this be done?
There are two ways that you can do this, one built in to EE's core function, the second using a widely used add-on.
Almost all dynamic variable use cases can be met using layout variables; a system that allows you to create and store single variable values and simple arrays during the evaluation of a template. You can store anything that can be generated as output by an EE template within a layout variable.
The quirk with layout variables is that the variables you define only become available for use after parsing of the template is complete, so the only way to use them within your page is to concurrently use EE's template layout system - which is not a bad thing, the template layout system is helpful and powerful. It lets you break the parsing of a template into the accummulation of the processing of two or more component templates: layout variables defined in a component template become available to the next (and all subsequent) templates in the sequence.
The alternative solution is to use an add-on called stash. This widely used add-on provides (amongst other things) a very similar mechanism for storing local / temporary values to that provided by layout variables, the primary difference being that stash variables become available for re-use upon definition (no need to wait until the template evaluation is complete).
By comparison layout variables do less (but usually enough) but are simpler to work with, though to get the best from them you need to learn also to structure your template designs to use the template layout system.