<?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 Tag: SQL - Recent Topics</title>
		<link>https://legacy.forums.gravityhelp.com/tags/sql</link>
		<description>Gravity Support Forums Tag: SQL - Recent Topics</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 18:17:19 +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/tags/sql/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>Luciano on "Questions about the client area and integrating SQL"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/questions-about-the-client-area-and-integrating-sql#post-328494</link>
			<pubDate>Mon, 17 Jun 2013 08:09:21 +0000</pubDate>
			<dc:creator>Luciano</dc:creator>
			<guid isPermaLink="false">328494@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello, I'm looking at the Gravity Forms and I am very interested in buying the developer version, I can not speak very well English, I hope you understand me.&#60;/p&#62;
&#60;p&#62;My goal is to create a form for pizzas, but I need so that when the client makes a request to access the client area to see the requests made.&#60;br /&#62;
is it possible?&#60;/p&#62;
&#60;p&#62;Also like to know when the client makes the request it be sent to a program done in sql server feeding the system with the data filled by the customer on site. It is also possible?&#60;/p&#62;
&#60;p&#62;thank you
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mabel888 on "Error on drop table during upgrade"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/error-on-drop-table-during-upgrade#post-195377</link>
			<pubDate>Wed, 03 Apr 2013 09:36:05 +0000</pubDate>
			<dc:creator>mabel888</dc:creator>
			<guid isPermaLink="false">195377@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've just upgraded to 1.6.12 and received the following error:&#60;br /&#62;
'WordPress database error: [DROP command denied to user 'intltrav_wrd1'@'localhost' for table 'Awp_rg_form']&#60;br /&#62;
DROP TABLE IF EXISTS Awp_rg_form'&#60;/p&#62;
&#60;p&#62;Is this something to be concerned about?  Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mattingly Graphics on "MS ACCESS and multiple tables"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/ms-access-and-multiple-tables#post-164820</link>
			<pubDate>Fri, 08 Mar 2013 17:17:00 +0000</pubDate>
			<dc:creator>Mattingly Graphics</dc:creator>
			<guid isPermaLink="false">164820@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have a client who has forms for user submission. The end target is Access... sort of. They don't need access as a database, but rather for querying and producing reports. The exported CSV adds a few extra steps, and we haven't been able to develop a workflow which allows allows them to simply export new entries, and have them properly import into access, purge for duplicates, etc...&#60;/p&#62;
&#60;p&#62;So I'm in the process of simply allowing Access to connect to the MySQL database tables for the RG_Leads tables. I can get in just fine, and the tables pull down great. But there are 3 of them. Now I need to run a Union query to pull the necessary data from the three different tables and populate a new table with that data.&#60;/p&#62;
&#60;p&#62;Has anyone had experience doing this? Any guidance or suggestions?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>octoberblue on "RG_LEAD_DETAIL table uniques"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/rg_lead_detail-table-uniques#post-149310</link>
			<pubDate>Mon, 18 Feb 2013 11:17:06 +0000</pubDate>
			<dc:creator>octoberblue</dc:creator>
			<guid isPermaLink="false">149310@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In the wp_rg_lead_detail table, taken together are the three columns &#34;lead_id&#34;, &#34;form_id&#34;, and &#34;field_number&#34; always unique?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ab24 on "SQL code to export/retrieve form entries from the previous day"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/sql-code-to-exportretrieve-form-entries-from-the-previous-day#post-143261</link>
			<pubDate>Wed, 06 Feb 2013 08:08:27 +0000</pubDate>
			<dc:creator>ab24</dc:creator>
			<guid isPermaLink="false">143261@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi :)&#60;/p&#62;
&#60;p&#62;I need to write a sql query to retrieve a list of form entries for the previous day.&#60;/p&#62;
&#60;p&#62;I can't seem to find the sql queries used for the admin page (through both the plugin code itself and by using 'savequeries' wp debug feature) which lists form entries, could you please advise how i could achieve this?&#60;/p&#62;
&#60;p&#62;The form in question (used for College courses applications) can be found here : &#60;a href=&#34;http://www.iwcollege.ac.uk/apply/&#34; rel=&#34;nofollow&#34;&#62;http://www.iwcollege.ac.uk/apply/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Any help, pointers or links much appreciated.&#60;/p&#62;
&#60;p&#62;Thanks in advance,&#60;/p&#62;
&#60;p&#62;Aaron
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Des Moines University on "Query form entries from outside of WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/query-form-entries-from-outside-of-wordpress#post-137750</link>
			<pubDate>Thu, 31 Jan 2013 17:39:12 +0000</pubDate>
			<dc:creator>Des Moines University</dc:creator>
			<guid isPermaLink="false">137750@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I know I can do a basic query of the database but is there any sort of API, functions, hooks etc. that can be used to easily pull form entries from outside of the WordPress environment?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>chris_s on "Updating forms in multisite"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/updating-forms-in-multisite#post-98006</link>
			<pubDate>Sun, 02 Dec 2012 14:43:58 +0000</pubDate>
			<dc:creator>chris_s</dc:creator>
			<guid isPermaLink="false">98006@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Currently I am running an install of multisite and occasionally adding a new group of sites at once. I'm using the export_file in my config file so it makes installing a breeze. But on occasion, we want to add fields to a form, that exist across all sites the same. So my question is, is there a way to update all the forms across multisite without having to create a new form and importing it? I am currently using for IDs in my theme files to access the forms. When these form ID's change, i.e., importing a new form, the theme files don't match. Now I know this isn't the best way to do it, but I can't think of another solution to be able to use the same forms across all sites in my multisite installation.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "How to limit the time that entries are retained?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-limit-the-time-that-entries-are-retained#post-116974</link>
			<pubDate>Tue, 08 Jan 2013 18:19:17 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">116974@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I would like to limit a form so that entries are retained for no longer than 90 days.&#60;/p&#62;
&#60;p&#62;That is, all entries over 90 days will be automatically erased.&#60;/p&#62;
&#60;p&#62;Is there a way to do this?  I don't see one.&#60;/p&#62;
&#60;p&#62;This is not the same as limiting the number of entries that a form will accept before locking people out.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>clueno1 on "populate hidden field from another form input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-hidden-field-from-another-form-input#post-107461</link>
			<pubDate>Tue, 25 Dec 2012 04:57:03 +0000</pubDate>
			<dc:creator>clueno1</dc:creator>
			<guid isPermaLink="false">107461@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello&#60;/p&#62;
&#60;p&#62;i am editing on multiple step form. In my first step, user select a Language from drop down. The choices are below.&#60;/p&#62;
&#60;p&#62;English, Spanish, French, Any&#60;/p&#62;
&#60;p&#62;In second step i need to connect to database and populate a hidden field with value comes from database. I want to use an another text value  and language value comes from first step to use in my database query.&#60;/p&#62;
&#60;p&#62;My code is here.. &#60;a href=&#34;http://pastie.org/5575350&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/5575350&#60;/a&#62; where is the problem?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>zerotofive on "Getting Form Object outside of standard hooks"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/getting-form-object-outside-of-standard-hooks#post-105044</link>
			<pubDate>Thu, 20 Dec 2012 15:20:17 +0000</pubDate>
			<dc:creator>zerotofive</dc:creator>
			<guid isPermaLink="false">105044@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is a somewhat uncommon request, but I have a client that wants to provide a custom HTML formatted email once a month to users.  The users should only receive product notices based on their choices in their sign up form that they initially signed up with.&#60;/p&#62;
&#60;p&#62;I am using a Cron Job to process the PHP code.  It will loop through all the users and return the relevant lead ID from the database (already working).  My question now is - I know the form ID, I know the lead ID - but how do I get the form OBJECT so I can start to manipulate it and pull data from it?&#60;/p&#62;
&#60;p&#62;Below is the code I have in the for each user loop - please help!&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;global $wpdb;

		//Figuring out if user has submitted form before
		$sql = &#38;quot;SELECT filtered.sort, l.*, d.field_number, d.value
		FROM wp_rg_lead l
		INNER JOIN wp_rg_lead_detail d ON d.lead_id = l.id
		INNER JOIN
		(
			SELECT @rownum:=@rownum + 1 as sort, id
			FROM
			(
				SELECT distinct l.id
				FROM wp_rg_lead l
				INNER JOIN wp_rg_lead_detail d ON d.lead_id = l.id
				WHERE
				l.form_id=&#38;quot;. $_GET[&#38;quot;formid&#38;quot;] .&#38;quot;

				 AND created_by=&#38;quot;. $iUserID .&#38;quot;
				 AND status=&#38;#39;active&#38;#39;

				ORDER BY date_created DESC
				LIMIT 1

			) page
		) filtered ON filtered.id = l.id
		ORDER BY filtered.sort&#38;quot;;

		//initializing rownum
		$wpdb-&#38;gt;query(&#38;quot;select @rownum:=0&#38;quot;);

		//getting results
		$results = $wpdb-&#38;gt;get_results($sql);

		$resultArray = array();

		foreach( $results as $result ){
			$leadID = $result-&#38;gt;id;
		}
		echo $leadID;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The code above does return the correct leadID, but for some reason in the for each results it does loop multiple times when it should only loop once for one result.  I am not concerned with that near as much as getting the form object so I can get the relevant checkbox data though.&#60;/p&#62;
&#60;p&#62;Thanks for any help.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
