<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Code The World — Add data to a MySQL database]]></title>
		<link>https://codetheworld.com/viewtopic.php?id=7</link>
		<atom:link href="https://codetheworld.com/extern.php?action=feed&amp;tid=7&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Add data to a MySQL database.]]></description>
		<lastBuildDate>Sun, 15 Jun 2008 01:05:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Add data to a MySQL database]]></title>
			<link>https://codetheworld.com/viewtopic.php?pid=7#p7</link>
			<description><![CDATA[<p>Description<br />How to insert and save information into a MySQL database table using PHP.</p><p>The code<br /></p><div class="codebox"><pre><code>&lt;?php

/**
 * Change the first line to whatever 
 * you use to connect to the database.
 *
 * We&#039;re using two values, title and
 * text. Replace these with whatever
 * you want to add to the database.
 *
 * Finally, change tablename to the 
 * name of your table.
 */

// Your database connection code
db_connect();

$query = &quot;INSERT INTO tablename(title, text) VALUES(&#039;$title&#039;,&#039;$text&#039;)&quot;;

$result = mysql_query($query);

echo &quot;The data has been added to the database.&quot;;

?&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Casper)]]></author>
			<pubDate>Sun, 15 Jun 2008 01:05:16 +0000</pubDate>
			<guid>https://codetheworld.com/viewtopic.php?pid=7#p7</guid>
		</item>
	</channel>
</rss>
