<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1023622" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1023622</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145139</link>
    <description> &lt;p&gt;&lt;a href=&quot;http://www.mysql.com/doc/en/DATETIME.html&quot; class=&quot;bb-url&quot;&gt;http://www.mysql.com/doc/en/DATETIME.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It was probably me. I feel like I link to that page weekly. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 29 Jan 2004 18:01:16 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1145139 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145127</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;section31 wrote:&lt;/strong&gt; HI, how do you prevent a date (timestamp) column from updating when doing an update to that row. Everytime I perform an update to a row the NOW() function causes it to update to the current time..I don&#039;t want that to happen. Can anyone help....I&#039;m sure there is a really easy solution to this.&lt;/p&gt;
&lt;p&gt;thanks,&lt;br /&gt;
Dave&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;timestamps are made to update whenever a non-select statemetn is run on the row. the only way to override that tis to either use a datetime feild which needs and explicit update, or to update that feild with the content that was previously there.&lt;/p&gt;
&lt;p&gt;i read this earlier this week wehn mark linked me to the date &amp;amp; time functions... or was it suzanne... might have been both....in any case, for a more in depth explanation, it&#039;s on the mysql manual at....ok. i can&#039;t seem to find it int he threads right now... anyone have it handy?&lt;/p&gt;
&lt;p&gt;you can always go to &lt;a href=&quot;http://www.mysql.com&quot; class=&quot;bb-url&quot;&gt;mysql.com&lt;/a&gt; and then search the manual for &quot;datetime&quot;&lt;/p&gt;
 </description>
     <pubDate>Thu, 29 Jan 2004 06:07:49 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1145127 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145124</link>
    <description> &lt;p&gt;So there&#039;s the thing, I guess, eh? No one has had this problem since we don&#039;t try to use timestamp for things that don&#039;t need it to be automatically updated. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 29 Jan 2004 03:12:37 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1145124 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145119</link>
    <description> &lt;p&gt;Sorry about this here the code he submited&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
UPDATE table SET field1=&#039;field2&#039; datefield=datefield;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;like i said i often use this for table that have fields insertiondate modifydate&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;UPDATE table1 SET toto=&amp;#039;ujdshgsjjsdh&amp;#039;,insertiondate=insertiondate;&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
 note that even if i don&#039;t update modifydate it will be automaticly since it is a timestamp field&lt;/p&gt;
 </description>
     <pubDate>Wed, 28 Jan 2004 22:14:26 +0000</pubDate>
 <dc:creator>druagord</dc:creator>
 <guid isPermaLink="false">comment 1145119 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145118</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;druagord wrote:&lt;/strong&gt; I use the solution provided by section31 in many applications that i have writen and it work very well&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Can you explain or link to section31?&lt;/p&gt;
 </description>
     <pubDate>Wed, 28 Jan 2004 22:10:50 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1145118 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145116</link>
    <description> &lt;p&gt;I use the solution provided by section31 in many applications that i have writen and it work very well&lt;/p&gt;
 </description>
     <pubDate>Wed, 28 Jan 2004 21:01:32 +0000</pubDate>
 <dc:creator>druagord</dc:creator>
 <guid isPermaLink="false">comment 1145116 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145114</link>
    <description> &lt;p&gt;You could make the field type a int(11), then produce your own timestamp; $timestamp = time(); and use this value. According to the &lt;a href=&quot;http://www.mysql.com/doc/en/DATETIME.html&quot; class=&quot;bb-url&quot;&gt;MySQL Documentation&lt;/a&gt;, the timestamp is working like it should&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
The TIMESTAMP column type provides a type that you can use to automatically mark INSERT or UPDATE operations with the current date and time. If you have multiple TIMESTAMP columns, only the first one is updated automatically. &lt;/p&gt;
&lt;p&gt;Automatic updating of the first TIMESTAMP column occurs under any of the following conditions: &lt;/p&gt;
&lt;p&gt;The column is not specified explicitly in an INSERT or LOAD DATA INFILE statement.&lt;br /&gt;
The column is not specified explicitly in an UPDATE statement and some other column changes value. (Note that an UPDATE that sets a column to the value it already has will not cause the TIMESTAMP column to be updated, because if you set a column to its current value, MySQL ignores the update for efficiency.)&lt;br /&gt;
You explicitly set the TIMESTAMP column to NULL.
&lt;/p&gt;&lt;/blockquote&gt;
 </description>
     <pubDate>Wed, 28 Jan 2004 20:28:10 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1145114 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145113</link>
    <description> &lt;p&gt;Well, i finally figured out a solution to this that never occured to me before...LOL&lt;/p&gt;
&lt;p&gt;Why don&#039;t I just set the date equal to the previous value which works fine and as far as I know thats the only way to preven mysql from updating the date field.&lt;/p&gt;
&lt;p&gt;Example, UPDATE table SET field1=&#039;field2&#039; datefield=datefield;&lt;/p&gt;
&lt;p&gt;horray.&lt;/p&gt;
 </description>
     <pubDate>Wed, 28 Jan 2004 20:03:51 +0000</pubDate>
 <dc:creator>section31</dc:creator>
 <guid isPermaLink="false">comment 1145113 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145112</link>
    <description> &lt;p&gt;I don&#039;t mean to say this as an insult, but I can&#039;t believe none of you haven&#039;t had this problem and you have no idea what i&#039;m talking about...geez.&lt;/p&gt;
&lt;p&gt;Ok...Lets start off with a simple example...lets say I have a table with 3 fields.&lt;br /&gt;
varchar(20) name&lt;br /&gt;
TIMESTAMP datet&lt;br /&gt;
TEXT message&lt;/p&gt;
&lt;p&gt;Ok, lets say I create a row -&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;INSERT INTO table (name,datet,message) VALUES (&amp;#039;idunno myname&amp;#039;, NOW(), &amp;#039;this is a long message&amp;#039;);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;NOTE: that I used the NOW() function which pushes the currentdate and time in whatever form the date datatype i&#039;m using.  In this case its a TIMESTAMP(14), which is 4 bytes and is in the form of YYYYMMDDHHMMSS.    Ok, now lets say I want to update that row to change the name or message.  &lt;/p&gt;
&lt;p&gt;Syntax would be something like this.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;UPDATE table SET message=&amp;#039;changed message&amp;#039; WHERE name=&amp;#039;idunno myname&amp;#039;&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
Now this is where my problem is...Notice I didn&#039;t do anything to the date field, yet mysql automatically updates the date field.  If I look at the row, the datet field will now be changed to when I last updated the row.  I don&#039;t want this, I want the datet field to remain the same.  &lt;/p&gt;
&lt;p&gt;I hope this helps for those of you that are confused..&lt;/p&gt;
&lt;p&gt;Thanks for any help in advance,&lt;br /&gt;
Dave&lt;/p&gt;
 </description>
     <pubDate>Wed, 28 Jan 2004 19:11:20 +0000</pubDate>
 <dc:creator>section31</dc:creator>
 <guid isPermaLink="false">comment 1145112 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-mysql-notionw-func-question#comment-1145094</link>
    <description> &lt;p&gt;Can you show us the query your running?&lt;/p&gt;
 </description>
     <pubDate>Wed, 28 Jan 2004 06:05:56 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1145094 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
