<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Code The World — Add data to a MySQL database]]></title>
	<link rel="self" href="https://codetheworld.com/extern.php?action=feed&amp;tid=7&amp;type=atom" />
	<updated>2008-06-15T01:05:16Z</updated>
	<generator>PunBB</generator>
	<id>https://codetheworld.com/viewtopic.php?id=7</id>
		<entry>
			<title type="html"><![CDATA[Add data to a MySQL database]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=7#p7" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Casper]]></name>
				<uri>https://codetheworld.com/profile.php?id=5</uri>
			</author>
			<updated>2008-06-15T01:05:16Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=7#p7</id>
		</entry>
</feed>
