<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Query advice</title>
		<link>https://legacy.forums.gravityhelp.com/topic/query-advice</link>
		<description>Gravity Support Forums Topic: Query advice</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 04:46:30 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/query-advice" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26798</link>
			<pubDate>Thu, 02 Jun 2011 11:11:29 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">26798@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry, Rbl, email is &#60;a href=&#34;mailto:david@rocketgenius.com&#34;&#62;david@rocketgenius.com&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rbl on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26762</link>
			<pubDate>Wed, 01 Jun 2011 19:22:26 +0000</pubDate>
			<dc:creator>rbl</dc:creator>
			<guid isPermaLink="false">26762@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks David! Where shall I send them to?&#60;/p&#62;
&#60;p&#62;Ricardo
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26710</link>
			<pubDate>Wed, 01 Jun 2011 12:26:13 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">26710@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Ricardo,&#60;/p&#62;
&#60;p&#62;If you send me a login to your WP admin and FTP, I will take a look.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rbl on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26689</link>
			<pubDate>Wed, 01 Jun 2011 09:06:52 +0000</pubDate>
			<dc:creator>rbl</dc:creator>
			<guid isPermaLink="false">26689@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi David!&#60;br /&#62;
I'm quite sure it's the right template as other elements I'm editing display.&#60;/p&#62;
&#60;p&#62;I've tried all variants of &#34;$form = RGFormsModel::get_form_meta($form_id);&#34; I've found in the forum threads and none, absolutely none, displays the form id, which I need to use in my query.&#60;/p&#62;
&#60;p&#62;Ricardo
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26582</link>
			<pubDate>Mon, 30 May 2011 14:27:59 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">26582@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Ricardo,&#60;/p&#62;
&#60;p&#62;Are you sure you are loading the correct page template? Try putting an &#38;lt;?php echo 'Test!'; ?&#38;gt; at the very top of whatever page template and see if it outputs 'Test!' to the screen.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rbl on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26546</link>
			<pubDate>Sat, 28 May 2011 14:44:16 +0000</pubDate>
			<dc:creator>rbl</dc:creator>
			<guid isPermaLink="false">26546@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks David but something is not working. Whatever code I place in functions seems to work, but I'm getting nothing from the template file, I can't even get it to echo the form id!&#60;/p&#62;
&#60;p&#62;I've been trying snippets and everything i've found here for most of the last hours.&#60;br /&#62;
Would appreciate if you can help me out as I feel I hit a wall.&#60;/p&#62;
&#60;p&#62;Thanks!&#60;br /&#62;
Ricardo
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26523</link>
			<pubDate>Sat, 28 May 2011 06:54:07 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">26523@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Ricardo,&#60;/p&#62;
&#60;p&#62;You'll want to paste this function in your theme's &#60;em&#62;functions.php&#60;/em&#62; file: &#60;a href=&#34;http://pastie.org/1984439&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1984439&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;And you'll want to paste this snippet in your page template file wherever you are intending to output your custom code: &#60;a href=&#34;http://pastie.org/1984444&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1984444&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;You can ditch the &#34;print_rr&#34; stuff, but it's useful for debugging by making larger arrays very readable.&#60;/p&#62;
&#60;p&#62;In regards to the best way to make queries, just use the &#60;strong&#62;$wpdb&#60;/strong&#62; class. More information here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://codex.wordpress.org/Class_Reference/wpdb&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Class_Reference/wpdb&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rbl on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26514</link>
			<pubDate>Fri, 27 May 2011 22:34:59 +0000</pubDate>
			<dc:creator>rbl</dc:creator>
			<guid isPermaLink="false">26514@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi David!&#60;/p&#62;
&#60;p&#62;After!&#60;/p&#62;
&#60;p&#62;Ricardo
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26509</link>
			<pubDate>Fri, 27 May 2011 21:48:34 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">26509@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Ricardo,&#60;/p&#62;
&#60;p&#62;Would the output of your custom code be displayed before or after the form?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rbl on "Query advice"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-advice#post-26452</link>
			<pubDate>Fri, 27 May 2011 10:26:21 +0000</pubDate>
			<dc:creator>rbl</dc:creator>
			<guid isPermaLink="false">26452@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi!&#60;br /&#62;
I have a simple form with 2 fields: a multiple answer with Yes and No values and a hidden IP address.&#60;br /&#62;
This form was made with generic labels to be duplicated every time it's needed in a new post.&#60;/p&#62;
&#60;p&#62;In every post where a form was included, I need to pull the results and display them and for this purpose, I think it would be better to manipulate the query and results directly in the template, lets say in the single post php file.&#60;/p&#62;
&#60;p&#62;I would appreciate your help in the following as I've found no answer in the docs and forum:&#60;br /&#62;
 - the best way to determine if the current post has a form (so that it executes or ignores the code bellow);&#60;br /&#62;
 - if it has a form, getting its ID and;&#60;br /&#62;
 - querying the database in a sensible way to take full advantage of a caching plugin like W3 Total Cache;&#60;/p&#62;
&#60;p&#62;Thanks for your help!&#60;br /&#62;
Ricardo
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
