<?xml version="1.0" encoding="UTF-8"?><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>Comments on: Inserting Data Into a MySQL Database using PHP</title>
	<atom:link href="http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php/feed" rel="self" type="application/rss+xml" />
	<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php</link>
	<description></description>
	<pubDate>Mon, 13 Oct 2008 18:39:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Thabiso Chizwe</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1754</link>
		<dc:creator>Thabiso Chizwe</dc:creator>
		<pubDate>Fri, 10 Oct 2008 08:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1754</guid>
		<description>when i click submit the whole contents of my php file are displayed in the html page

here is my script

&#60;?php

$Title= $_POST['Title'];
$FirstName= $_POST['FirstName'];
$Surname= $_POST['Surname'];
$JobTitle= $_POST['JobTitle'];
$Company=$_POST['Company'];
$Department= $_POST['Department'];
$Office= $_POST['Office'];
$BusinessPhone= $_POST['BusinessPhone'];
$HomePhone= $_POST['HomePhone'];
$Fax= $_POST['Fax'];
$Cell =$_POST['Cell'];
$Email = $_POST['Email'];
$WebPageAddress= $_POST['WebPageAddress'];
$PhysicalAddress= $_POST['PhysicalAddress'];
$MailingAddress= $_POST['MailingAddress'];
$Birthday= $_POST['Birthday'];
$month= $_POST['month'];
$year = $_POST['year'];

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Error connecting to MySQL");
mysql_select_db($dbname, $conn) or die ("Could not open database");

$query="INSERT INTO contacts(Title,FirstName,Surname,JobTitle,Company,Department,Office,BusinessPhone,HomePhone,Fax,Cell,Email,WebPageAddress,PhysicalAddress,MailingAddress,Birthday,month,year)VALUES('".$Title"', '"$FirstName"','"$Surname"','"$JobTitle"','"$Company'",'".$Department'",'".$Office"','".$BussinessPhone'",'".$HomePhone'",'".$Fax"','"$Cell"','".$Email"','".$WebPageAddress"','".$PhysicalAddress"','".$MailingAddress"','".$Birthday"','".$month"','".$year"')";
mysql_query($query);
echo "Record Added&lt;a href="contacts.html" rel="nofollow"&gt;click here&lt;/a&gt;to return to contacts";

$result = mysql_query($query);

mysql_close($db1);
mysql_close($conn);
echo "";

?&#62;</description>
		<content:encoded><![CDATA[<p>when i click submit the whole contents of my php file are displayed in the html page</p>
<p>here is my script</p>
<p>&lt;?php</p>
<p>$Title= $_POST['Title'];<br />
$FirstName= $_POST['FirstName'];<br />
$Surname= $_POST['Surname'];<br />
$JobTitle= $_POST['JobTitle'];<br />
$Company=$_POST['Company'];<br />
$Department= $_POST['Department'];<br />
$Office= $_POST['Office'];<br />
$BusinessPhone= $_POST['BusinessPhone'];<br />
$HomePhone= $_POST['HomePhone'];<br />
$Fax= $_POST['Fax'];<br />
$Cell =$_POST['Cell'];<br />
$Email = $_POST['Email'];<br />
$WebPageAddress= $_POST['WebPageAddress'];<br />
$PhysicalAddress= $_POST['PhysicalAddress'];<br />
$MailingAddress= $_POST['MailingAddress'];<br />
$Birthday= $_POST['Birthday'];<br />
$month= $_POST['month'];<br />
$year = $_POST['year'];</p>
<p>$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (&#8221;Error connecting to MySQL&#8221;);<br />
mysql_select_db($dbname, $conn) or die (&#8221;Could not open database&#8221;);</p>
<p>$query=&#8221;INSERT INTO contacts(Title,FirstName,Surname,JobTitle,Company,Department,Office,BusinessPhone,HomePhone,Fax,Cell,Email,WebPageAddress,PhysicalAddress,MailingAddress,Birthday,month,year)VALUES(&#8217;&#8221;.$Title&#8221;&#8216;, &#8216;&#8221;$FirstName&#8221;&#8216;,&#8217;&#8221;$Surname&#8221;&#8216;,&#8217;&#8221;$JobTitle&#8221;&#8216;,&#8217;&#8221;$Company&#8217;&#8221;,&#8217;&#8221;.$Department&#8217;&#8221;,&#8217;&#8221;.$Office&#8221;&#8216;,&#8217;&#8221;.$BussinessPhone&#8217;&#8221;,&#8217;&#8221;.$HomePhone&#8217;&#8221;,&#8217;&#8221;.$Fax&#8221;&#8216;,&#8217;&#8221;$Cell&#8221;&#8216;,&#8217;&#8221;.$Email&#8221;&#8216;,&#8217;&#8221;.$WebPageAddress&#8221;&#8216;,&#8217;&#8221;.$PhysicalAddress&#8221;&#8216;,&#8217;&#8221;.$MailingAddress&#8221;&#8216;,&#8217;&#8221;.$Birthday&#8221;&#8216;,&#8217;&#8221;.$month&#8221;&#8216;,&#8217;&#8221;.$year&#8221;&#8216;)&#8221;;<br />
mysql_query($query);<br />
echo &#8220;Record Added<a href="contacts.html" rel="nofollow">click here</a>to return to contacts&#8221;;</p>
<p>$result = mysql_query($query);</p>
<p>mysql_close($db1);<br />
mysql_close($conn);<br />
echo &#8220;&#8221;;</p>
<p>?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjeev</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1747</link>
		<dc:creator>Sanjeev</dc:creator>
		<pubDate>Tue, 07 Oct 2008 08:03:12 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1747</guid>
		<description>this is sanjeev 
i have written that code but i am not able to update data in my sql , 
i am getting the error.

Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\sandeep\update.php on line 9


pls help me



</description>
		<content:encoded><![CDATA[<p>this is sanjeev<br />
i have written that code but i am not able to update data in my sql ,<br />
i am getting the error.</p>
<p>Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\sandeep\update.php on line 9</p>
<p>pls help me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1739</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Thu, 02 Oct 2008 22:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1739</guid>
		<description>"sanitizing database inputs"

Okay, got it. Thanks . . . and funny cartoon.</description>
		<content:encoded><![CDATA[<p>&#8220;sanitizing database inputs&#8221;</p>
<p>Okay, got it. Thanks . . . and funny cartoon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Ward</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1738</link>
		<dc:creator>John Ward</dc:creator>
		<pubDate>Thu, 02 Oct 2008 20:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1738</guid>
		<description>Christina look up sanitizing database inputs. This will gt you started http://xkcd.com/327/ . Not sure about the radio buttons, echo the query and see if the value is being sent.</description>
		<content:encoded><![CDATA[<p>Christina look up sanitizing database inputs. This will gt you started <a href="http://xkcd.com/327/" rel="nofollow">http://xkcd.com/327/</a> . Not sure about the radio buttons, echo the query and see if the value is being sent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1737</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Thu, 02 Oct 2008 20:20:16 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1737</guid>
		<description>Thanks, John, for the response. Okay, I basically have it working now. You can fill out all the fields and it'll populate the database. Only two problems remain (and they are minor compared to what I was facing before but still important):

1. If the user uses a character such as an apostrophe it prevents the database from populating.

2. It's not populating the product field, which is the only field in this form that utilizes radio buttons.</description>
		<content:encoded><![CDATA[<p>Thanks, John, for the response. Okay, I basically have it working now. You can fill out all the fields and it&#8217;ll populate the database. Only two problems remain (and they are minor compared to what I was facing before but still important):</p>
<p>1. If the user uses a character such as an apostrophe it prevents the database from populating.</p>
<p>2. It&#8217;s not populating the product field, which is the only field in this form that utilizes radio buttons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1734</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Tue, 30 Sep 2008 19:59:51 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1734</guid>
		<description>Okay, I have an update and clarification. When I use:


 


the database does get populated. But when I use:






The database does not get populated and a blank screen appears.</description>
		<content:encoded><![CDATA[<p>Okay, I have an update and clarification. When I use:</p>
<p>the database does get populated. But when I use:</p>
<p>The database does not get populated and a blank screen appears.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Ward</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1733</link>
		<dc:creator>John Ward</dc:creator>
		<pubDate>Tue, 30 Sep 2008 19:23:50 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1733</guid>
		<description>Try either of these:

$query = 'INSERT INTO clientsopennew (orderID, orderDate)VALUES (NULL,"$orderDate")';

$query = "INSERT INTO clientsopennew (orderID, orderDate)VALUES (NULL,'".$orderdate."')";</description>
		<content:encoded><![CDATA[<p>Try either of these:</p>
<p>$query = &#8216;INSERT INTO clientsopennew (orderID, orderDate)VALUES (NULL,&#8221;$orderDate&#8221;)&#8217;;</p>
<p>$query = &#8220;INSERT INTO clientsopennew (orderID, orderDate)VALUES (NULL,&#8217;&#8221;.$orderdate.&#8221;&#8216;)&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Ward</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1732</link>
		<dc:creator>John Ward</dc:creator>
		<pubDate>Tue, 30 Sep 2008 19:17:49 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1732</guid>
		<description>Christian, try to echo your sql variable after you create it. Seems it is not creating a valid update.</description>
		<content:encoded><![CDATA[<p>Christian, try to echo your sql variable after you create it. Seems it is not creating a valid update.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1731</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Tue, 30 Sep 2008 18:41:57 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1731</guid>
		<description>Still no answer for my question.</description>
		<content:encoded><![CDATA[<p>Still no answer for my question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Maguire</title>
		<link>http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1700</link>
		<dc:creator>Mike Maguire</dc:creator>
		<pubDate>Mon, 22 Sep 2008 02:05:41 +0000</pubDate>
		<guid isPermaLink="false">http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#comment-1700</guid>
		<description>Sasha:

Check out this tutorial that I wrote a while ago:

http://teamtutorials.com/photoshop-tutorials/web-graphics/sql-select-based-on-text-inserted-into-a-text-box

I think it is what you are looking for. Thanks.</description>
		<content:encoded><![CDATA[<p>Sasha:</p>
<p>Check out this tutorial that I wrote a while ago:</p>
<p><a href="http://teamtutorials.com/photoshop-tutorials/web-graphics/sql-select-based-on-text-inserted-into-a-text-box" rel="nofollow">http://teamtutorials.com/photoshop-tutorials/web-graphics/sql-select-based-on-text-inserted-into-a-text-box</a></p>
<p>I think it is what you are looking for. Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
