<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1054425" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1054425</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Well, first, are the top</title>
    <link>https://www.webmaster-forums.net/web-database-development/why-input-data-cannot-save-database#comment-1280804</link>
    <description> &lt;p&gt;Well, first, are the top section of code and the bottom section supposed to be the same script?? This is confusing as to what you are trying to accomplish&lt;/p&gt;
&lt;p&gt;Best guess with limited information:&lt;/p&gt;
&lt;p&gt;$_POST[&#039;txtadd&#039;] contains a single quote, which is breaking the query. (Any variables to be using in a query for data should be wrapped with &lt;strong&gt;mysql_real_escape_string()&lt;/strong&gt; to protect it from breaking due to this (and to minimize SQL injection. Think if for $_POST[&#039;txtadd&#039;] someone put &lt;strong&gt;my remark&#039;); drop table _kursus; //&lt;/strong&gt;  you would loose your table!)&lt;/p&gt;
&lt;p&gt;If it is not an issue with the slashes, then time to track what is wrong. You say &quot;the INSERT query does not function&quot;. Have you verified that no data has actually be added to the database. (some people just don&#039;t &quot;see&quot; in the web page what they expect, and say it doesn&#039;t work&quot;)&lt;/p&gt;
&lt;p&gt;If there is no record even added to the database, modify it to:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$sql = &amp;#039;INSERT INTO `_kursus` (`remark`) VALUES (&amp;quot;&amp;#039;.mysql_real_escape_string($txtadd).&amp;#039;&amp;quot;)&amp;#039;;&lt;br /&gt;$result = mysql_query($sql) or die (&amp;#039;SQL FAILED:&amp;lt;br&amp;gt;&amp;#039;.$sql.&amp;quot;&amp;lt;br&amp;gt;Error: &amp;#039;mysql_error());&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;is it generating an error?  How does the SQL statement look? (sometimes in code it is difficult to see a typo, but when you look at the final SQL statement you can see it easier).&lt;/p&gt;
&lt;p&gt;Need more exact answer that what mysql_error() gave? Try manually executing the query on the database.&lt;/p&gt;
&lt;p&gt;Don&#039;t forget, when you are done debugging,  take out the die() statement that displays the actual SQL statement. On a production environment, you never want to show your SQL to the user on an error, (honestly, you shouldn&#039;t directly echo out mysql_error() either, why give a hacker &quot;inside information&quot; on how the site is set up)&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Sun, 30 Sep 2012 11:22:16 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1280804 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
