<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Use Triggers to Track Changes in MySQL</title>
	<atom:link href="http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/</link>
	<description></description>
	<lastBuildDate>Thu, 29 Dec 2011 08:28:29 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Denis Pujdak</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15261</link>
		<dc:creator>Denis Pujdak</dc:creator>
		<pubDate>Sat, 25 Jun 2011 16:54:04 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15261</guid>
		<description>It is possible to use Checksum MySQL  &lt;a href=&quot;http://adm-it.net/checksum-mysql&quot; rel=&quot;nofollow&quot;&gt;http://adm-it.net/checksum-mys...&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>It is possible to use Checksum MySQL  <a href="http://adm-it.net/checksum-mysql" rel="nofollow"></a><a href="http://adm-it.net/checksum-mys.." rel="nofollow">http://adm-it.net/checksum-mys..</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15255</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Fri, 01 Apr 2011 14:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15255</guid>
		<description>As a bit of a follow up....  I guess the way that it is currently set up it would insert two times into the history_clients table if your UPDATE contained a change to the first AND last name.  Maybe there is a reason for doing this, but I would think that reflecting BOTH changes in one row in the history_clients table would be the way to go.  That is why I am wondering if we could somehow combine them.</description>
		<content:encoded><![CDATA[<p>As a bit of a follow up&#8230;.  I guess the way that it is currently set up it would insert two times into the history_clients table if your UPDATE contained a change to the first AND last name.  Maybe there is a reason for doing this, but I would think that reflecting BOTH changes in one row in the history_clients table would be the way to go.  That is why I am wondering if we could somehow combine them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15256</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Fri, 01 Apr 2011 14:40:06 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15256</guid>
		<description>Hello,&lt;br&gt;&lt;br&gt;I am wondering if there is a way to combine the 2 if statements in the MySQL trigger.  Instead of having one to check and see if there has been a change to the first name and a SEPARATE check to see if there has been a change to the last name would it be possible to combine them?&lt;br&gt;&lt;br&gt;I guess what I am asking is if MySQL can support a structure such as IF( A != B &#124;&#124; C != D){...  If &quot;a&quot; or &quot;b&quot; is the following...  or even an IF (A != B &amp;&amp; C != D){...  If &quot;a&quot; and &quot;b&quot; do the following.&lt;br&gt;&lt;br&gt;Thanks in advance,&lt;br&gt;Rick</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I am wondering if there is a way to combine the 2 if statements in the MySQL trigger.  Instead of having one to check and see if there has been a change to the first name and a SEPARATE check to see if there has been a change to the last name would it be possible to combine them?</p>
<p>I guess what I am asking is if MySQL can support a structure such as IF( A != B || C != D){&#8230;  If &#8220;a&#8221; or &#8220;b&#8221; is the following&#8230;  or even an IF (A != B &amp;&amp; C != D){&#8230;  If &#8220;a&#8221; and &#8220;b&#8221; do the following.</p>
<p>Thanks in advance,<br />Rick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: how to get pregnant fast</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15248</link>
		<dc:creator>how to get pregnant fast</dc:creator>
		<pubDate>Thu, 03 Feb 2011 05:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15248</guid>
		<description>Thanks for sharing your mind with us.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing your mind with us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ana30soberano</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15239</link>
		<dc:creator>Ana30soberano</dc:creator>
		<pubDate>Sat, 23 Oct 2010 03:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15239</guid>
		<description>-using phpmyadmin actuly im using xampplite wuold u help me?</description>
		<content:encoded><![CDATA[<p>-using phpmyadmin actuly im using xampplite wuold u help me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ana30soberano</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15240</link>
		<dc:creator>Ana30soberano</dc:creator>
		<pubDate>Sat, 23 Oct 2010 03:27:57 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15240</guid>
		<description>-hai would u,,,create simple log in,,that if the username is wrong...then,,,the echo wuold be wrong pass and username?</description>
		<content:encoded><![CDATA[<p>-hai would u,,,create simple log in,,that if the username is wrong&#8230;then,,,the echo wuold be wrong pass and username?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15217</link>
		<dc:creator>Ali</dc:creator>
		<pubDate>Sat, 01 May 2010 16:37:18 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15217</guid>
		<description>great to have found this site.  I have used all search engines to find someone trying to update a table based on input changes.  My issue was:&lt;br&gt;1- keep loading a table everyday.  &lt;br&gt;2- data rows that is to load the table are repetitive.  Not all of them change in value&lt;br&gt;3- once i use insert .... on duplicate key update .  The table updates with the new information irrespective whether the values are equal or not.  I am not sure why, but I have a timestamp field among the fields.  And, i am passing a current_timestamp() function in the insert statement.  This is needed to timestamp new records, and timestamp the duplicate key records if any of their values differ. &lt;br&gt;What I ended up getting, an updated timestamp that is always current.  I lose track whether a real change exist in the values themselves. I think timestamp fields update with a timestamp irrespective whether other values change, that&#039;s because the timestamp field by itself changed.  Enough to execute the update.  This is the first caveat.  What I really want is to leave the row unchanged based on the values i am checking and reset the timestamp to the old one.&lt;br&gt;so, the trigger helped me achieve that by putting an if then else statement.  Similar to the above, yet introduced the else and SET new.timestamp = old.timestamp, new.counter=old.counter.  My if checks all the values that might have changes with &lt;br&gt;IF NEW.VALUE&lt;&gt;OLD.VALUE OR NEW.VALUE_1 &lt;&gt; OLD.VALUE_1 for all values ..., &lt;br&gt;THEN INSERT INTO history_table SELECT * FROM table WHERE identifiers are =.. &lt;br&gt;(The OLD.* didn&#039;t work.)&lt;br&gt;ELSE SET NEW.TIMESTAMP=OLD.TIMESTAMP, NEW.COUNTER=OLD.COUNTER&lt;br&gt;&lt;br&gt;That did the magic, because it neutralized the new buffer to the old buffer and the update needn&#039;t to execute.&lt;br&gt;&lt;br&gt;Hope that helps those who have the same issue.</description>
		<content:encoded><![CDATA[<p>great to have found this site.  I have used all search engines to find someone trying to update a table based on input changes.  My issue was:<br />1- keep loading a table everyday.  <br />2- data rows that is to load the table are repetitive.  Not all of them change in value<br />3- once i use insert &#8230;. on duplicate key update .  The table updates with the new information irrespective whether the values are equal or not.  I am not sure why, but I have a timestamp field among the fields.  And, i am passing a current_timestamp() function in the insert statement.  This is needed to timestamp new records, and timestamp the duplicate key records if any of their values differ. <br />What I ended up getting, an updated timestamp that is always current.  I lose track whether a real change exist in the values themselves. I think timestamp fields update with a timestamp irrespective whether other values change, that&#39;s because the timestamp field by itself changed.  Enough to execute the update.  This is the first caveat.  What I really want is to leave the row unchanged based on the values i am checking and reset the timestamp to the old one.<br />so, the trigger helped me achieve that by putting an if then else statement.  Similar to the above, yet introduced the else and SET new.timestamp = old.timestamp, new.counter=old.counter.  My if checks all the values that might have changes with <br />IF NEW.VALUE&lt;&gt;OLD.VALUE OR NEW.VALUE_1 &lt;&gt; OLD.VALUE_1 for all values &#8230;, <br />THEN INSERT INTO history_table SELECT * FROM table WHERE identifiers are =.. <br />(The OLD.* didn&#39;t work.)<br />ELSE SET NEW.TIMESTAMP=OLD.TIMESTAMP, NEW.COUNTER=OLD.COUNTER</p>
<p>That did the magic, because it neutralized the new buffer to the old buffer and the update needn&#39;t to execute.</p>
<p>Hope that helps those who have the same issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15208</link>
		<dc:creator>Anthony</dc:creator>
		<pubDate>Fri, 22 Jan 2010 10:58:24 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15208</guid>
		<description>perfect... exactly what I was looking for.</description>
		<content:encoded><![CDATA[<p>perfect&#8230; exactly what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phani Kumar Varanasi</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15202</link>
		<dc:creator>Phani Kumar Varanasi</dc:creator>
		<pubDate>Thu, 12 Nov 2009 04:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15202</guid>
		<description>Yeah Dear, the concept you entered is so helpful, well good work.</description>
		<content:encoded><![CDATA[<p>Yeah Dear, the concept you entered is so helpful, well good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abhinavzone</title>
		<link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/comment-page-1/#comment-15188</link>
		<dc:creator>abhinavzone</dc:creator>
		<pubDate>Wed, 29 Jul 2009 16:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://codespatter.com/?p=36#comment-15188</guid>
		<description>Thank you very much!!! it saved my day</description>
		<content:encoded><![CDATA[<p>Thank you very much!!! it saved my day</p>
]]></content:encoded>
	</item>
</channel>
</rss>

