<?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: MySQL Triggers Tutorial</title>
	<atom:link href="http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Sun, 07 Mar 2010 23:31:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Crisitan</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-47892</link>
		<dc:creator>Crisitan</dc:creator>
		<pubDate>Sun, 21 Feb 2010 20:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-47892</guid>
		<description>Thank you so much for explaining this, i never properly read the docs. Have been using oracle too much.</description>
		<content:encoded><![CDATA[<p>Thank you so much for explaining this, i never properly read the docs. Have been using oracle too much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shaun</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-43257</link>
		<dc:creator>shaun</dc:creator>
		<pubDate>Fri, 25 Sep 2009 05:59:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-43257</guid>
		<description>Thanks for the tutorial. Haven&#039;t worked much with triggers and this was helpful.</description>
		<content:encoded><![CDATA[<p>Thanks for the tutorial. Haven&#8217;t worked much with triggers and this was helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tsogoo</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-39781</link>
		<dc:creator>tsogoo</dc:creator>
		<pubDate>Mon, 22 Jun 2009 10:08:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-39781</guid>
		<description>hi. i have a question. how to ALTER TABLE in CREATE TRIGGER? i want to ADD ROW in TABLE 
for example:
    ALTER TABLE `faqs` ADD &#039;question_&#039;+NEW.code INT NOT NULL;
    ALTER TABLE `faqs` ADD &#039;answer_&#039;+NEW.code INT NOT NULL;</description>
		<content:encoded><![CDATA[<p>hi. i have a question. how to ALTER TABLE in CREATE TRIGGER? i want to ADD ROW in TABLE<br />
for example:<br />
    ALTER TABLE `faqs` ADD &#8216;question_&#8217;+NEW.code INT NOT NULL;<br />
    ALTER TABLE `faqs` ADD &#8216;answer_&#8217;+NEW.code INT NOT NULL;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mysql Trigger Tutorial and Tools &#124; Learning On Demand</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-39613</link>
		<dc:creator>Mysql Trigger Tutorial and Tools &#124; Learning On Demand</dc:creator>
		<pubDate>Thu, 18 Jun 2009 15:50:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-39613</guid>
		<description>[...] MySQL Triggers Tutorial, more detail explanation of mysql trigger line per line. [...]</description>
		<content:encoded><![CDATA[<p>[...] MySQL Triggers Tutorial, more detail explanation of mysql trigger line per line. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cruise</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-35411</link>
		<dc:creator>cruise</dc:creator>
		<pubDate>Wed, 04 Mar 2009 05:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-35411</guid>
		<description>Hey, everyone
Can you help me?
I have problem. I have trigger that definer is my own create. When i disable my own create, my trigger is error. I want alter my trigger with other definer that I must not drop it then recreate.</description>
		<content:encoded><![CDATA[<p>Hey, everyone<br />
Can you help me?<br />
I have problem. I have trigger that definer is my own create. When i disable my own create, my trigger is error. I want alter my trigger with other definer that I must not drop it then recreate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dani Yusuf</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-34509</link>
		<dc:creator>Dani Yusuf</dc:creator>
		<pubDate>Mon, 02 Feb 2009 05:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-34509</guid>
		<description>Hey Everyone…

I’ve been searching all over for the answer to this one. If you have the answer, it would help me out a lot! 

Using MySQL triggers for SMS Gateway, I have table “inbox” and table “voting”, I want to input table &quot;voting&quot; automatictly whenever SMS come (store in table inbox)I try to creat script and try to sens messange like this &quot;man 5 3 4 10 20 30 40 50 60 70 80 90 100 11 22&quot;: 

CREATE TRIGGER smsin AFTER INSERT ON inbox  
FOR EACH ROW
$row = array(&quot;TextDecoded&quot;);
$cut=explode(&quot; &quot;,$row);

if ($cut[1]=&#039;man&#039;)
    {
     $query = mysql_query (&quot;insert into voting1 values
     (&#039; &#039;,&#039;$cut1[0]&#039;,&#039;$cut1[1]&#039;,&#039;$cut1[2]&#039;,&#039;$cut1[3]&#039;,&#039;$cut1[4]&#039;,
     &#039;$cut1[5]&#039;,&#039;$cut1[6]&#039;,&#039;$cut1[7]&#039;,&#039;$cut1[8]&#039;,&#039;$cut1[9]&#039;,
	 &#039;$cut1[10]&#039;,&#039;$cut1[11]&#039;,&#039;$cut1[12]&#039;,&#039;$cut1[13]&#039;,&#039;$cut1[14]&#039;,&#039;$cut1[15]&#039;,&#039;$cut1[16]&#039;)&quot;);
	}
else
    {
     $query = mysql_query (&quot;insert into voting2 values
     (&#039; &#039;,&#039;$cut1[0]&#039;,&#039;$cut1[1]&#039;,&#039;$cut1[2]&#039;,&#039;$cut1[3]&#039;,&#039;$cut1[4]&#039;,
     &#039;$cut1[5]&#039;,&#039;$cut1[6]&#039;,&#039;$cut1[7]&#039;,&#039;$cut1[8]&#039;,&#039;$cut1[9]&#039;,
	 &#039;$cut1[10]&#039;,&#039;$cut1[11]&#039;,&#039;$cut1[12]&#039;,&#039;$cut1[13]&#039;,&#039;$cut[14]&#039;)&quot;);
     }


Buat it didn&#039;t run... could anybody can help ? 
I Really appreciate.

Thanks all!</description>
		<content:encoded><![CDATA[<p>Hey Everyone…</p>
<p>I’ve been searching all over for the answer to this one. If you have the answer, it would help me out a lot! </p>
<p>Using MySQL triggers for SMS Gateway, I have table “inbox” and table “voting”, I want to input table &#8220;voting&#8221; automatictly whenever SMS come (store in table inbox)I try to creat script and try to sens messange like this &#8220;man 5 3 4 10 20 30 40 50 60 70 80 90 100 11 22&#8243;: </p>
<p>CREATE TRIGGER smsin AFTER INSERT ON inbox<br />
FOR EACH ROW<br />
$row = array(&#8221;TextDecoded&#8221;);<br />
$cut=explode(&#8221; &#8220;,$row);</p>
<p>if ($cut[1]=&#8217;man&#8217;)<br />
    {<br />
     $query = mysql_query (&#8221;insert into voting1 values<br />
     (&#8217; &#8216;,&#8217;$cut1[0]&#8216;,&#8217;$cut1[1]&#8216;,&#8217;$cut1[2]&#8216;,&#8217;$cut1[3]&#8216;,&#8217;$cut1[4]&#8216;,<br />
     &#8216;$cut1[5]&#8216;,&#8217;$cut1[6]&#8216;,&#8217;$cut1[7]&#8216;,&#8217;$cut1[8]&#8216;,&#8217;$cut1[9]&#8216;,<br />
	 &#8216;$cut1[10]&#8216;,&#8217;$cut1[11]&#8216;,&#8217;$cut1[12]&#8216;,&#8217;$cut1[13]&#8216;,&#8217;$cut1[14]&#8216;,&#8217;$cut1[15]&#8216;,&#8217;$cut1[16]&#8216;)&#8221;);<br />
	}<br />
else<br />
    {<br />
     $query = mysql_query (&#8221;insert into voting2 values<br />
     (&#8217; &#8216;,&#8217;$cut1[0]&#8216;,&#8217;$cut1[1]&#8216;,&#8217;$cut1[2]&#8216;,&#8217;$cut1[3]&#8216;,&#8217;$cut1[4]&#8216;,<br />
     &#8216;$cut1[5]&#8216;,&#8217;$cut1[6]&#8216;,&#8217;$cut1[7]&#8216;,&#8217;$cut1[8]&#8216;,&#8217;$cut1[9]&#8216;,<br />
	 &#8216;$cut1[10]&#8216;,&#8217;$cut1[11]&#8216;,&#8217;$cut1[12]&#8216;,&#8217;$cut1[13]&#8216;,&#8217;$cut[14]&#8216;)&#8221;);<br />
     }</p>
<p>Buat it didn&#8217;t run&#8230; could anybody can help ?<br />
I Really appreciate.</p>
<p>Thanks all!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arun Patjosy</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-33705</link>
		<dc:creator>Arun Patjosy</dc:creator>
		<pubDate>Mon, 05 Jan 2009 14:10:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-33705</guid>
		<description>I just followed above article and is help ful to me. I m first time using trigger, it is perfect article for a bigainer.</description>
		<content:encoded><![CDATA[<p>I just followed above article and is help ful to me. I m first time using trigger, it is perfect article for a bigainer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexei Larramendi</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-32392</link>
		<dc:creator>Alexei Larramendi</dc:creator>
		<pubDate>Mon, 01 Dec 2008 18:39:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-32392</guid>
		<description>Hi, very good explanation of all the examples and theory you give to the folk. Thank you for the good job.

I have a question that I cannot resolve yet and I hope you can help me out.

I&#039;m using MySQL 5.1.29 RC and I wrote a database with some tables one of them is called &quot;users&quot;. I want to create a trigger before insert on the table &quot;login&quot;. ie. before inserting any value in the table &quot;login&quot; I want to insert some values in another table called &quot;users&quot;, my code is below:

First I created my tables with the following syntax:

create users
(
  userID int unsigned not null auto_increment  primary key,
  company char(50)
)type=innodb; 

create login
(
  userID int unsigned not null,
  username char(100),
  password char(100) not null unique  
)type=innodb;

After That I created the trigger:

create triger test_trg before insert on login
for each row begin
  insert into users values(NULL,&#039; &#039;);
end;

result: it doesn&#039;t work, I have tried using also those syntaxes:

create triger test_trg before insert on login
for each row begin
  insert into users values(&#039;0&#039;,&#039; &#039;);
end;

create triger test_trg before insert on login
for each row begin
  insert into users values(0);
end;

create triger test_trg before insert on login
for each row begin
  insert into users set userID = &#039;0&#039;;
  insert into users set company = &#039;somecmpy&#039;;
end;

create triger test_trg before insert on login
for each row begin
  insert into users set userID = 0;
  insert into users set company = &#039;somecmpy&#039;;
end;

Result: I couldn&#039;t create my trigger yet.

Again:
I want to create a trigger before insert on the table &quot;login&quot;. ie. before inserting any value in the table &quot;login&quot; I want to insert a new value &quot;userID&quot; for the table &quot;users&quot;. Can you give me any clue about the problem. Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi, very good explanation of all the examples and theory you give to the folk. Thank you for the good job.</p>
<p>I have a question that I cannot resolve yet and I hope you can help me out.</p>
<p>I&#8217;m using MySQL 5.1.29 RC and I wrote a database with some tables one of them is called &#8220;users&#8221;. I want to create a trigger before insert on the table &#8220;login&#8221;. ie. before inserting any value in the table &#8220;login&#8221; I want to insert some values in another table called &#8220;users&#8221;, my code is below:</p>
<p>First I created my tables with the following syntax:</p>
<p>create users<br />
(<br />
  userID int unsigned not null auto_increment  primary key,<br />
  company char(50)<br />
)type=innodb; </p>
<p>create login<br />
(<br />
  userID int unsigned not null,<br />
  username char(100),<br />
  password char(100) not null unique<br />
)type=innodb;</p>
<p>After That I created the trigger:</p>
<p>create triger test_trg before insert on login<br />
for each row begin<br />
  insert into users values(NULL,&#8217; &#8216;);<br />
end;</p>
<p>result: it doesn&#8217;t work, I have tried using also those syntaxes:</p>
<p>create triger test_trg before insert on login<br />
for each row begin<br />
  insert into users values(&#8217;0&#8242;,&#8217; &#8216;);<br />
end;</p>
<p>create triger test_trg before insert on login<br />
for each row begin<br />
  insert into users values(0);<br />
end;</p>
<p>create triger test_trg before insert on login<br />
for each row begin<br />
  insert into users set userID = &#8216;0&#8242;;<br />
  insert into users set company = &#8217;somecmpy&#8217;;<br />
end;</p>
<p>create triger test_trg before insert on login<br />
for each row begin<br />
  insert into users set userID = 0;<br />
  insert into users set company = &#8217;somecmpy&#8217;;<br />
end;</p>
<p>Result: I couldn&#8217;t create my trigger yet.</p>
<p>Again:<br />
I want to create a trigger before insert on the table &#8220;login&#8221;. ie. before inserting any value in the table &#8220;login&#8221; I want to insert a new value &#8220;userID&#8221; for the table &#8220;users&#8221;. Can you give me any clue about the problem. Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-31440</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Tue, 11 Nov 2008 19:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-31440</guid>
		<description>Dio: 

If you&#039;re talking about 1 machine with multiple schemas: did you try prefixing the database name before your table?  

If you&#039;re talking about 2 different database servers, I don&#039;t think you can do that with MySQL.</description>
		<content:encoded><![CDATA[<p>Dio: </p>
<p>If you&#8217;re talking about 1 machine with multiple schemas: did you try prefixing the database name before your table?  </p>
<p>If you&#8217;re talking about 2 different database servers, I don&#8217;t think you can do that with MySQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dio</title>
		<link>http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/comment-page-1/#comment-31419</link>
		<dc:creator>Dio</dc:creator>
		<pubDate>Tue, 11 Nov 2008 06:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/09/14/mysql-triggers-tutorial/#comment-31419</guid>
		<description>how to trigger between two database??</description>
		<content:encoded><![CDATA[<p>how to trigger between two database??</p>
]]></content:encoded>
	</item>
</channel>
</rss>
