<?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: gform_after_submission - writing to a MySQL database</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database</link>
		<description>Gravity Support Forums Topic: gform_after_submission - writing to a MySQL database</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 18:40:47 +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/gform_after_submission-writing-to-a-mysql-database" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-318047</link>
			<pubDate>Tue, 11 Jun 2013 23:43:17 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">318047@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Not assuming anything is how I helped ;) Glad you got it sorted.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>andrew carbn on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-317585</link>
			<pubDate>Tue, 11 Jun 2013 17:45:07 +0000</pubDate>
			<dc:creator>andrew carbn</dc:creator>
			<guid isPermaLink="false">317585@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks David! By assuming I am an idiot, you have helped me to realise I am an idiot! :-)&#60;/p&#62;
&#60;p&#62;I didn't realise there is more than one functions.php file!&#60;/p&#62;
&#60;p&#62;It's all working now. Couldn't be happier right now.&#60;/p&#62;
&#60;p&#62;Thanks loads for your help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-317472</link>
			<pubDate>Tue, 11 Jun 2013 16:17:21 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">317472@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You shouldn't have received that error message. You are adding this code to the functions.php file for your theme, correct? In your wp-content/themes/selectedtheme/functions.php file?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-317471</link>
			<pubDate>Tue, 11 Jun 2013 16:17:21 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">317471@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You shouldn't have received that error message. You are adding this code to the functions.php file for your theme, correct? In your wp-content/themes/selectedtheme/functions.php file?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>andrew carbn on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-317438</link>
			<pubDate>Tue, 11 Jun 2013 15:39:50 +0000</pubDate>
			<dc:creator>andrew carbn</dc:creator>
			<guid isPermaLink="false">317438@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Bryan thanks for the quick reply. &#60;/p&#62;
&#60;p&#62;Yes the mySQL query does execute correctly by its self.&#60;/p&#62;
&#60;p&#62;I tried adding the code to functions.php but it kept crashing my site with an error code saying add_action... was undefined. So I removed just that line and that stopped it from crashing. I then added the add_action line into the php of the page, just above the form short-code, but again nothing was happening.&#60;/p&#62;
&#60;p&#62;I'm new to PHP and mySQL but I'm reasonably sure the problem is that the hook is not firing at all. Is there a way to check?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>smartclouddesign on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-317328</link>
			<pubDate>Tue, 11 Jun 2013 13:32:23 +0000</pubDate>
			<dc:creator>smartclouddesign</dc:creator>
			<guid isPermaLink="false">317328@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Andrew- I did get my code to work and send me an email (test) after submission. Make sure you put this code in your functions.php file of your theme. I'm on a friend's computer now (mine is in the Apple shop). Later this week when I get it back (hopefully tomorrow), if you are still having issues, I'll write to a dB to test the code.&#60;/p&#62;
&#60;p&#62;Does your PHP code write to a database if executed on it's own?&#60;/p&#62;
&#60;p&#62;Bryan
&#60;/p&#62;</description>
		</item>
		<item>
			<title>andrew carbn on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-317312</link>
			<pubDate>Tue, 11 Jun 2013 13:04:57 +0000</pubDate>
			<dc:creator>andrew carbn</dc:creator>
			<guid isPermaLink="false">317312@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey,&#60;/p&#62;
&#60;p&#62;I'm also trying to do exactly the same thing. I have a bit more code BUT IT ISN'T WORKING FOR ME.&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
add_action(&#34;gform_after_submission_9&#34;, &#34;push_fields&#34;, 10, 2);&#60;br /&#62;
function push_fields($entry, $form){&#60;/p&#62;
&#60;p&#62;$uploaderName = $entry[&#34;1&#34;];&#60;br /&#62;
$organiserName = $entry[&#34;2&#34;];&#60;br /&#62;
$organiserEmail = $entry[&#34;3&#34;];&#60;br /&#62;
$organiserNumber = $entry[&#34;4&#34;];&#60;br /&#62;
$venueNumber = $entry[&#34;5&#34;];&#60;/p&#62;
&#60;p&#62;$con=mysqli_connect(&#34;hostname&#34;,&#34;username&#34;,&#34;password&#34;,&#34;dbname&#34;);&#60;br /&#62;
mysqli_query($con,&#34;INSERT INTO table (uploaderName, organiserName,&#60;br /&#62;
organiserEmail, organiserNumber, venueNumber) VALUES ('$uploaderName',&#60;br /&#62;
'$organiserName', '$organiserEmail', '$organiserNumber', '$venueNumber')&#34;);&#60;br /&#62;
}&#60;br /&#62;
?&#38;gt;&#60;/p&#62;
&#60;p&#62;The Entry Object is detailed here:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Entry_Object&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Entry_Object&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Hope this gives you some ideas. The code above shows no errors but also has no effect.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>smartclouddesign on "gform_after_submission - writing to a MySQL database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-writing-to-a-mysql-database#post-313520</link>
			<pubDate>Sun, 09 Jun 2013 22:49:41 +0000</pubDate>
			<dc:creator>smartclouddesign</dc:creator>
			<guid isPermaLink="false">313520@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi- I would like to take my form submission and write certain fields to a database. The fields I would need to get into variable form so I can write to the database would be name, email, website. The code below is what I found to get me started, but I don't know how to create the variables which will pull the associated fields I need.&#60;/p&#62;
&#60;p&#62;I have the code to write to the database, I just need to pull those variables from the form submission. If anyone can help, I'd really appreciate it.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Bryan&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
add_action('gform_after_submission', 'post_to_third_party', 10, 2);&#60;br /&#62;
function post_to_third_party($entry, $form) {&#60;/p&#62;
&#60;p&#62;//  Need to create variables with the form values name/email/website&#60;/p&#62;
&#60;p&#62;}&#60;br /&#62;
?&#38;gt;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
