<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Walanchai Blog</title>
	<atom:link href="http://www.walanchai.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.walanchai.info</link>
	<description>Computer Internet Security Server FreeBSD Linux</description>
	<lastBuildDate>Wed, 24 Jun 2009 10:14:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL แสดงข้อมูลที่เพิ่มเข้ามาไม่เกิน 1 เดือน</title>
		<link>http://www.walanchai.info/2009/mysql-%e0%b9%81%e0%b8%aa%e0%b8%94%e0%b8%87%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b8%97%e0%b8%b5%e0%b9%88%e0%b9%80%e0%b8%9e%e0%b8%b4%e0%b9%88%e0%b8%a1%e0%b9%80%e0%b8%82%e0%b9%89/</link>
		<comments>http://www.walanchai.info/2009/mysql-%e0%b9%81%e0%b8%aa%e0%b8%94%e0%b8%87%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b8%97%e0%b8%b5%e0%b9%88%e0%b9%80%e0%b8%9e%e0%b8%b4%e0%b9%88%e0%b8%a1%e0%b9%80%e0%b8%82%e0%b9%89/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 10:10:46 +0000</pubDate>
		<dc:creator>TheBoy</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.walanchai.info/?p=69</guid>
		<description><![CDATA[
SELECT * FROM table_data WHERE(NOW() &#62;= date_add AND NOW() &#60; DATE_ADD(date_add, INTERVAL 1 MONTH))
เป็นคำสั่ง SQL ที่เลือกข้อมูลทั้งหมด จากตาราง table_data โดย วันเวลาเพิ่มข้อมูล(date_add) ต้องเท่ากับหรือน้อยกว่าวันเวลาปัจจุบัน และวันที่ปัจจุบันต้องน้อยกว่าวันที่บันทึก+1 เดือน 
เพียงเท่านี้ระบบก็จะแสดงข้อมูลที่เพิ่มเข้ามาในระยะเวลา 3 เดือนให้ครับ

]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-40 aligncenter" title="logo-mysql" src="http://www.walanchai.info/wp-content/uploads/2009/03/logo-mysql.jpg" alt="logo-mysql" width="399" height="291" /></p>
<p><span style="color: #ff0000;">SELECT * FROM <span style="color: #0000ff;">table_data</span> WHERE(NOW() &gt;= <span style="color: #0000ff;">date_add</span> AND NOW() &lt; DATE_ADD(<span style="color: #0000ff;">date_add</span>, INTERVAL 1 MONTH))</span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">เป็นคำสั่ง SQL ที่เลือกข้อมูลทั้งหมด จากตาราง <span style="color: #0000ff;">table_data</span> โดย วันเวลาเพิ่มข้อมูล(<span style="color: #0000ff;">date_add</span>) ต้องเท่ากับหรือน้อยกว่าวันเวลาปัจจุบัน และวันที่ปัจจุบันต้องน้อยกว่า<span style="color: #0000ff;">วันที่บันทึก+1 เดือน </span></span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;"><span style="color: #0000ff;"><span style="color: #000000;">เพียงเท่านี้ระบบก็จะแสดงข้อมูลที่เพิ่มเข้ามาในระยะเวลา 3 เดือนให้</span>ครับ<br />
</span></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walanchai.info/2009/mysql-%e0%b9%81%e0%b8%aa%e0%b8%94%e0%b8%87%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b8%97%e0%b8%b5%e0%b9%88%e0%b9%80%e0%b8%9e%e0%b8%b4%e0%b9%88%e0%b8%a1%e0%b9%80%e0%b8%82%e0%b9%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AntiARP 6.0.1 (Anti netcut)</title>
		<link>http://www.walanchai.info/2009/antiarp-anti-netcut/</link>
		<comments>http://www.walanchai.info/2009/antiarp-anti-netcut/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 12:49:51 +0000</pubDate>
		<dc:creator>TheBoy</dc:creator>
				<category><![CDATA[Hacking & Security]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[ARP Poisoning]]></category>
		<category><![CDATA[ARP Spoofing]]></category>
		<category><![CDATA[Attack]]></category>
		<category><![CDATA[IP Address]]></category>
		<category><![CDATA[MAC Address]]></category>
		<category><![CDATA[เครือข่าย]]></category>
		<category><![CDATA[โจมตี]]></category>

		<guid isPermaLink="false">http://www.walanchai.info/?p=49</guid>
		<description><![CDATA[คราวที่แล้วผมได้เขียนเรื่อง ARP Spoofing ไว้ ละก้อยังได้ติดค้างวิธีแก้ไขเอาไว้ด้วย คราวนี้ก็เลยนำพระเอกของเรามาแจกครับ มันคือโปรแกรม AntiARP 6.0.1  ซึ่งเป็นโปรแกรมที่สามารถใช้ป้องกัน netcut ได้เป็นอย่างดี (มากๆ) ]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><span style="color: #ff0000;"><strong>สงวนลิขสิทธิ์บทความนี้ หากต้องการเผยแพร่ โปรดเผยแพร่ link นี้โดยตรง</strong></span></p>
<p style="text-align: center;"><img class="size-full wp-image-58 aligncenter" title="antiarp logo" src="http://www.walanchai.info/wp-content/uploads/2009/03/index_27_en.png" alt="antiarp logo" width="148" height="155" /></p>
<p style="text-align: left;">คราวที่แล้วผมได้เขียนเรื่อง ARP Spoofing ไว้ ซึ่งเป็นเทคนิคที่โปรแกรมเมอร์นำมาใช้ทำ netcut กัน และก็ยังได้ติดค้างวิธีแก้ไข netcut เอาไว้ด้วย คราวนี้ก็เลยนำพระเอกของเรามาแจกครับ มันคือโปรแกรม AntiARP 6.0.1? ซึ่งเป็นโปรแกรมที่สามารถใช้ป้องกัน netcut ได้เป็นอย่างดี (มากๆ) สามารถดูรายละเอียดต่างๆได้ที่เว็บผู้ผลิตครับ</p>
<p><a class="aligncenter" title="antiarp website" href="http://www.antiarp.com" target="_blank">http://www.antiarp.com</a></p>
<p>พร้อมทั้งยังสามารถดาวน์โหลดตัวทดลอง (เวอร์ชันภาษาจีน) มาใช้งานได้ 15 วันครับ จากเว็บผู้ผลิตเลยครับ</p>
<p>แต่ผมมี link พิเศษให้ครับ ซึ่งมีพร้อมทุกอย่าง ในนั้นครับ ปัญหา netcut จะหมดไป เมื่อคุณคลิกลิงค์นี้ (เหมือนโฆษณาเลย 555+)</p>
<p><a href="http://rapidshare.com/files/183220700/AntiARP-En_6.0.0-www.learn-pedia.com.rar">http://rapidshare.com/files/183220700/AntiARP-En_6.0.0-www.learn-pedia.com.rar</a></p>
<p><strong>วิธีใช้งานก็คือ</strong></p>
<p>1. เปิดโปรแกรมขึ้นมา จะพบกับหน้าจอดังนี้</p>
<p style="text-align: center;"><img class="size-full wp-image-56 aligncenter" title="antiarp1" src="http://www.walanchai.info/wp-content/uploads/2009/03/1.jpg" alt="antiarp1" width="531" height="382" /></p>
<p style="text-align: center;">กดที่ Nornal Install ได้เลยครับ (สำหรับ Silent Install ผมยังไม่เคยลองใช้ครับ)</p>
<p>?</p>
<p>2. โปรแกรมนี้มีอายุ 15 วันถ้าหมดอายุ ต้อง uninstall ออกก่อน แล้วกดที่ Patch จะพบกับหน้าจอดังภาพ</p>
<p style="text-align: center;"><img class="size-full wp-image-55 aligncenter" title="antiarp2" src="http://www.walanchai.info/wp-content/uploads/2009/03/2.jpg" alt="antiarp2" width="326" height="236" /></p>
<p style="text-align: center;">ให้กด Start Patch ครับ จากนั้นก็?Normal Install?ใหม่ครับ</p>
<p>วิธีใช้งานมันก็มีแค่นี้แหละครับ ต้อง uninstall แล้ว patch ใหม่ ทุกๆ 15 วัน netcut ก็จะไม่สามารถรบกวนคุณได้อีกต่อไป หากมีปัญหาประการใด มาโพสต์คุยกันได้ครับ</p>
<p>รหัสผ่านที่ใช่แตกไฟล์คือ <span style="color: #ff0000;">www.learn-pedia.com</span> นะครับ ต้องขอโทษที่ผมลืมบอกไว้ครับ และก็ขอขอบคุณทุกคำแนะนำ ติ-ชม นะครับ ขอบคุณครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walanchai.info/2009/antiarp-anti-netcut/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>ฟังก์ชัน หาจำนวนวันโดยใช้ MySQL (Date Difference MySQL)</title>
		<link>http://www.walanchai.info/2009/date-diff-mysql/</link>
		<comments>http://www.walanchai.info/2009/date-diff-mysql/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 08:51:10 +0000</pubDate>
		<dc:creator>TheBoy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.walanchai.info/?p=52</guid>
		<description><![CDATA[$link=mysql_connect("localhost","mysqluser","mysqlpassword");

//$dNow=date("Y-m-d");
$dNow="2008-03-08 00-00-00";
$dDate="1986-09-04 00-00-00";]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-40 aligncenter" title="logo-mysql" src="http://www.walanchai.info/wp-content/uploads/2009/03/logo-mysql.jpg" alt="logo-mysql" width="399" height="291" /></p>
<p>&lt;?php<br />
/* ==================================<br />
Date difference using MySQL by http://php-busy.blogspot.com<br />
================================== */</p>
<p>$link=mysql_connect(&#8221;localhost&#8221;,&#8221;mysqluser&#8221;,&#8221;mysqlpassword&#8221;);</p>
<p>//$dNow=date(&#8221;Y-m-d&#8221;);<br />
$dNow=&#8221;2008-03-08 00-00-00&#8243;;<br />
$dDate=&#8221;1986-09-04 00-00-00&#8243;;</p>
<p>// Query for get number of day between $dNow and $dDate<br />
$dDayDiff=mysql_query(&#8221;SELECT DATEDIFF(&#8217;$dNow&#8217;,'$dDate&#8217;);&#8221;);<br />
$iResult=mysql_result($dDayDiff,0)-1;<br />
echo &#8220;- Day between $dNow and $dDate is &#8220;.$iResult.&#8221; days<br />
&#8220;; // display day between $dNow and $dDate</p>
<p>// Initializing for Year difference<br />
$iYearNow=date(&#8221;Y&#8221;);<br />
$iYearSplit=split(&#8221;-&#8221;,$dDate);<br />
$iYearDate=$iYearSplit[0];<br />
$iYear=$iYearNow-$iYearDate;</p>
<p>// Query for day of all year<br />
for($i=0;$i&lt;=$iYear-1;$i++)<br />
{<br />
$dYearDiff=mysql_query(&#8221;SELECT DAYOFYEAR(&#8217;$iYearDate-12-31&#8242;);&#8221;); // Query for day of year<br />
$iYearResult=mysql_result($dYearDiff,0);<br />
$aYear[$i]=$iYearResult;<br />
$iYearDate++;<br />
}</p>
<p>// Count day of year<br />
$iSumDay=$iResult;<br />
for($i=0;$i&lt;=$iYear-1;$i++)<br />
{<br />
if ($iSumDay&gt;=$aYear[$i]) {<br />
$iSumDay=$iSumDay-$aYear[$i];<br />
} else {<br />
$iYear=$i;<br />
break;<br />
}<br />
}<br />
echo &#8220;- Date difference is : &#8220;.$iYear.&#8221; years, &#8220;.$iSumDay.&#8221; days<br />
&#8220;; // Display result</p>
<p>/* ==================================<br />
I start it&#8217;s for using to count year only, other difference is you.<br />
================================== */<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walanchai.info/2009/date-diff-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การ LEFT JOIN 3 table ใน MySQL</title>
		<link>http://www.walanchai.info/2009/mysql-left-join-3-table/</link>
		<comments>http://www.walanchai.info/2009/mysql-left-join-3-table/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 09:49:16 +0000</pubDate>
		<dc:creator>TheBoy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[join]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.walanchai.info/?p=43</guid>
		<description><![CDATA[สำหรับบางคน แค่การ LEFT JOIN 2 ตารางก็ยากพอแล้ว ใช้วิธี Query ออกมา หลายๆรอบดีกว่า ซึ่งมันก็ง่ายดีนะครับ แต่ผมว่า มันไม่เทพ!! ฮ่าๆๆ พอดีวันนี้เราจะเป็นเทพกันนะครับ มาเริ่มกันเลยดีกว่า

ถ้าหากผมมีตารางในฐานข้อมูล  3 ตาราง ประกอบด้วยตาราง ภาค (zone),  จังหวัด (province),  อำเภอ (district) นะครับ]]></description>
			<content:encoded><![CDATA[<p>สำหรับบางคน แค่การ LEFT JOIN 2 ตารางก็ยากพอแล้ว ใช้วิธี Query ออกมา หลายๆรอบดีกว่า ซึ่งมันก็ง่ายดีนะครับ แต่ผมว่า มันไม่เทพ!! ฮ่าๆๆ พอดีวันนี้เราจะเป็นเทพกันนะครับ มาเริ่มกันเลยดีกว่า</p>
<p>ถ้าหากผมมีตารางในฐานข้อมูล  3 ตาราง ประกอบด้วยตาราง ภาค (zone),  จังหวัด (province),  อำเภอ (district) นะครับ</p>
<table border="0" cellspacing="3" cellpadding="0" width="100%" align="center">
<tbody>
<tr>
<td align="center" valign="top">
<table border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#cccccc">
<tbody>
<tr>
<td colspan="3" valign="top" bgcolor="#cccccc">
<p align="center">อำเภอ (district)</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">district_id</p>
</td>
<td valign="top">
<p align="center">province_id</p>
</td>
<td valign="top">
<p align="center">district_name</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">1</p>
</td>
<td valign="top">
<p align="center">3</p>
</td>
<td valign="top">
<p align="center">เมืองเชียงใหม่</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">3</p>
</td>
<td valign="top">
<p align="center">สารภี</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">3</p>
</td>
<td valign="top">
<p align="center">3</p>
</td>
<td valign="top">
<p align="center">ดอยสะเก็ด</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">4</p>
</td>
<td valign="top">
<p align="center">4</p>
</td>
<td valign="top">
<p align="center">สันกำแพง</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">5</p>
</td>
<td valign="top">
<p align="center">4</p>
</td>
<td valign="top">
<p align="center">ดอยหล่อ</p>
</td>
</tr>
</tbody>
</table>
</td>
<td align="center" valign="top">
<table border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#cccccc">
<tbody>
<tr>
<td colspan="3" valign="top" bgcolor="#cccccc">
<p align="center">จังหวัด (province)</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">province_id</p>
</td>
<td valign="top">
<p align="center">zone_id</p>
</td>
<td valign="top">
<p align="center">province_name</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">1</p>
</td>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">เมืองเชียงใหม่</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">สารภี</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">3</p>
</td>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">ดอยสะเก็ด</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">4</p>
</td>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">สันกำแพง</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">5</p>
</td>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">ดอยหล่อ</p>
</td>
</tr>
</tbody>
</table>
</td>
<td align="center" valign="top">
<table border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#cccccc">
<tbody>
<tr>
<td colspan="2" valign="top" bgcolor="#cccccc">
<p align="center">ภาค (zone)</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">zone_id</p>
</td>
<td valign="top">
<p align="center">zone_name</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">1</p>
</td>
<td valign="top">
<p align="center">กลาง</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">2</p>
</td>
<td valign="top">
<p align="center">เหนือ</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">3</p>
</td>
<td valign="top">
<p align="center">ใต้</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">4</p>
</td>
<td valign="top">
<p align="center">ตะวันออก</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="center">5</p>
</td>
<td valign="top">
<p align="center">ตะวันตก</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>ความต้องการคือ แสดงผลอำเภอ โดยให้แสดงจังหวัด และภาคด้วย ซึ่งจากการวิเคราะห์ออกมา จะเห็นว่า ข้อมูลที่ต้องแสดงมี 3 อย่าง แต่ละอย่างอยู่คนละตาราง ส่วนข้อมูลที่ต้องการคือ อำเภอ ดั้งนั้นจะเขียน SQL Statement ได้ดังนี้</p>
<p style="color: #0000ff; text-align: left;">SELECT district.district_name, province.province_name, zone.zone_name FROM district LEFT JOIN province ON  province.province_id = district.province_id LEFT JOIN zone ON province.zone_id = zone.zone_id WHERE district.district_name =  &#8216;ชื่ออำเภอที่ต้องการ&#8217;</p>
<p>ดูๆแล้วไม่ยากเลยนะครับ แต่ผมคิดว่า หากเลี่ยงการ JOIN ตารางต่างๆได้ ก็ควรเลี่ยงนะครับ เพราะว่าถ้าหากมีข้อมูลใน record เยอะๆ มันกิน process เยอะมาก และใช้เวลาในการประมวลผลนานครับ ถ้าจะให้ดีควรใช้ SQL Statement แบบนี้ดีกว่า</p>
<p style="color: #0000ff; text-align: left;">SELECT district.district_name,province.province_name,zone.zone_name FROM district,province,zone WHERE (province.province_id = district.province_id) AND (province.zone_id = zone.zone_id) AND (district.district_name =  &#8216;ชื่ออำเภอที่ต้องการ&#8217;);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walanchai.info/2009/mysql-left-join-3-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การคัดลอกตารางใน mysql (mysql copy table)</title>
		<link>http://www.walanchai.info/2009/mysql-copy-table/</link>
		<comments>http://www.walanchai.info/2009/mysql-copy-table/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 14:39:42 +0000</pubDate>
		<dc:creator>TheBoy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.walanchai.info/?p=35</guid>
		<description><![CDATA[หลายๆคนคงอยากรู้ว่ามันมีวิธีการยังไง แทนที่เราจะพิมพ์คำสั่งยาวๆ แต่เราทำให้มันสั้นได้ครับ ไปดูกันเลย

 

CREATE TABLE student2 SELECT * FROM student 


เป็นคำสั่งคัดลอกตาราง โดยสร้างตารางสำเนาขึ้นมาใหม่ ในตัวอย่างหมายถึง คำสั่งคัดลอกตาราง student ทั้งหมด ไปสร้างตารางใหม่ชื่อ student2 โดยสามารถใส่ condition ต่อท้าย ได้ตามปกติ เช่นใส่ WHERE , ORDER BY หรือ GROUP BY 
]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><span style="color: #000000;"><img class="size-full wp-image-40 aligncenter" title="logo-mysql" src="http://www.walanchai.info/wp-content/uploads/2009/03/logo-mysql.jpg" alt="logo-mysql" width="399" height="291" /></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><span style="color: #000000;">หลายๆคนคงอยากรู้ว่ามันมีวิธีการยังไง แทนที่เราจะพิมพ์คำสั่งยาวๆ แต่เราทำให้มันสั้นได้ครับ ไปดูกันเลย</span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;">?</p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">CREATE TABLE student2 SELECT * FROM student<span style="text-decoration: underline;"> </span></span></p>
<p class="MsoNormal" style="text-justify: inter-cluster; text-align: justify; line-height: normal; margin: 0cm 0cm 0pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><br />
<span lang="TH">เป็นคำสั่งคัดลอกตาราง โดยสร้างตารางสำเนาขึ้นมาใหม่ ในตัวอย่างหมายถึง คำสั่งคัดลอกตาราง </span></span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">student</span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';" lang="TH"> ทั้งหมด ไปสร้างตารางใหม่ชื่อ </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">student2</span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"> <span lang="TH">โดยสามารถใส่ </span>condition <span lang="TH">ต่อท้าย ได้ตามปกติ เช่นใส่ </span>WHERE , ORDER BY <span lang="TH">หรือ </span>GROUP BY</span>
</p>
<p class="MsoNormal" style="text-align: justify; line-height: normal; margin: 0cm 0cm 0pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">?</span></p>
<table class="MsoNormalTable" style="text-align: center; mso-cellspacing: 1.5pt; mso-yfti-tbllook: 1184;" border="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes;">
<td style="width: 20.55pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0cm;" width="27" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">id</span></strong></p>
</td>
<td style="width: 62.25pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">name</span></strong></p>
</td>
<td style="width: 41.05pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">class</span></strong></p>
</td>
<td style="width: 33.2pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">mark</span></strong></p>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="width: 20.55pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="27" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">1</span></p>
</td>
<td style="width: 62.25pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">preecha</span></p>
</td>
<td style="width: 41.05pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">75</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="width: 20.55pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="27" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">2</span></p>
</td>
<td style="width: 62.25pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">aekapong</span></p>
</td>
<td style="width: 41.05pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Three</span></p>
</td>
<td style="width: 33.2pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">85</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="width: 20.55pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="27" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">3</span></p>
</td>
<td style="width: 62.25pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">namtan</span></p>
</td>
<td style="width: 41.05pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Three</span></p>
</td>
<td style="width: 33.2pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">55</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td style="width: 20.55pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="27" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">4</span></p>
</td>
<td style="width: 62.25pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">somchai</span></p>
</td>
<td style="width: 41.05pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">60</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 5;">
<td style="width: 20.55pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="27" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">5</span></p>
</td>
<td style="width: 62.25pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">thanorm</span></p>
</td>
<td style="width: 41.05pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">60</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 6; mso-yfti-lastrow: yes;">
<td style="width: 20.55pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="27" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">6</span></p>
</td>
<td style="width: 62.25pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">surapol</span></p>
</td>
<td style="width: 41.05pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">55</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-align: justify; line-height: normal; margin: 0cm 0cm 12pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">?</span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';" lang="TH">ตัวอย่างการใช้งานเบื้องต้น</span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">CREATE TABLE student2 SELECT * FROM student WHERE class=&#8217;Four&#8217; </span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">?</span></p>
<table class="MsoNormalTable" style="mso-cellspacing: 1.5pt; mso-yfti-tbllook: 1184;" border="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes;">
<td style="width: 21.3pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0.75pt;" width="28" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">id</span></strong></p>
</td>
<td style="width: 62.25pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0.75pt;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">name</span></strong></p>
</td>
<td style="width: 41.05pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0.75pt;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">class</span></strong></p>
</td>
<td style="width: 33.2pt; background: #c4bc96; mso-background-themecolor: background2; mso-background-themeshade: 191; border: #f4f4f4; padding: 0.75pt;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><strong><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">mark</span></strong></p>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="width: 21.3pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="28" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">1</span></p>
</td>
<td style="width: 62.25pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">preecha</span></p>
</td>
<td style="width: 41.05pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">75</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="width: 21.3pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="28" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">4</span></p>
</td>
<td style="width: 62.25pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">somchai</span></p>
</td>
<td style="width: 41.05pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">60</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="width: 21.3pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="28" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">5</span></p>
</td>
<td style="width: 62.25pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">thanorm</span></p>
</td>
<td style="width: 41.05pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #dddddd; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">60</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 4; mso-yfti-lastrow: yes;">
<td style="width: 21.3pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="28" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">6</span></p>
</td>
<td style="width: 62.25pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="83" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">surapol</span></p>
</td>
<td style="width: 41.05pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="55" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">Four</span></p>
</td>
<td style="width: 33.2pt; background: #cccccc; border: #f4f4f4; padding: 0cm;" width="44" valign="top">
<p class="MsoNormal" style="text-align: center; line-height: normal; margin: 0cm 0cm 0pt;" align="center"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">55</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 12pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">?</span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 12pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';" lang="TH">จากตัวอย่างจะสร้างตารางใหม่ โดยมีเงื่อนไขคือ </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">class <span lang="TH">ต้องเป็น </span>Four <span lang="TH">เท่านั้น</span><br />
<br style="mso-special-character: line-break;" /><br style="mso-special-character: line-break;" /></span>
</p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">CREATE TABLE IF NOT EXISTS student5 SELECT * FROM student WHERE class=&#8217;Four&#8217; </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;" lang="TH">คำสั่งนี้จะตรวจสอบก่อนว่า มีตาราง </span><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt;">student5</span><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> <span lang="TH">อยู่หรือไม่ ถ้าไม่มี ถึงจะสร้างตาราง<span style="color: blue;"> </span></span><span style="color: blue;">student5</span> <span lang="TH">โดยคัดลอกข้อมูลมาจากตาราง </span><span style="color: blue;">student</span> <span lang="TH">โดยมีเงื่อนไขว่าเอาเฉพาะ </span>class = Four <span lang="TH">เท่านั้น</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;">?</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;" lang="TH">คำสั่งคัดลอกไม่ได้มีเฉพาะการสร้างตารางใหม่เท่านั้น ยังรวมไปถึงตารางที่มีอยู่แล้ว เช่น</span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">INSERT INTO student2 SELECT * FROM student WHERE class=&#8217;Four&#8217; </span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 3.75pt;"><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';" lang="TH">คือคัดลอกข้อมูลจากตาราง </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">student </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';" lang="TH">ไปยังตาราง </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">student2 </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';" lang="TH">ซึ่งในกรณีนี้ตาราง </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">student2 </span><span style="font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';" lang="TH">จะต้องมีอยู่แล้ว</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;">?</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;" lang="TH">คำสั่งคัดลอกบางฟิลล์เท่านั้น เช่น</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: blue; font-size: 12pt;">INSERT INTO student2 (studentID, name, class) SELECT id, name, class FROM student WHERE mark &gt; 60</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;" lang="TH">หมายถึงคัดลอกฟิลล์ </span><span style="line-height: 115%; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; font-size: 12pt;">id, name, class <span lang="TH">จากตาราง </span><span style="color: blue;">student</span> <span lang="TH">ไปยังตาราง </span><span style="color: blue;">student2</span> <span lang="TH">โดยเก็บไว้ในฟิลล์ </span>studentID, name, class <span lang="TH">โดยมีเงื่อนไขคือ ฟิลล์ </span>mark &gt; 60</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walanchai.info/2009/mysql-copy-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARP Spoofing &amp; ARP Poisoning</title>
		<link>http://www.walanchai.info/2008/arp-spoofing-arp-poisoning/</link>
		<comments>http://www.walanchai.info/2008/arp-spoofing-arp-poisoning/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 19:17:06 +0000</pubDate>
		<dc:creator>TheBoy</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Hacking & Security]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[ARP Poisoning]]></category>
		<category><![CDATA[ARP Spoofing]]></category>
		<category><![CDATA[Attack]]></category>
		<category><![CDATA[IP Address]]></category>
		<category><![CDATA[MAC Address]]></category>
		<category><![CDATA[เครือข่าย]]></category>
		<category><![CDATA[โจมตี]]></category>

		<guid isPermaLink="false">http://www.walanchai.info/?p=13</guid>
		<description><![CDATA[ARP Spoofing และ?ARP Poisoning เป็นการโจมตีเครือข่ายรูปแบบหนึ่ง โดยการส่ง MAC Address ปลอมไปให้เครื่องต่างๆ ในระบบเครือข่าย ผมขอเรียกมันว่าอุปกรณ์ในเครือข่ายดีกว่า เพราะว่ามันสามารถที่จะหลอกอุปกรณ์ทุกชนิดในระบบเครือข่าย?โดย MAC Address ที่ส่งไปนั้น จะทำให้อุปกรณ์ต่างๆ ติดต่อไปยัง MAC Address ปลอมที่ส่งมา ส่งผลให้อุปกรณ์นั้น ไม่สามารถใช้งานระบบเครือข่ายได้
ก่อนอื่นเรามาทำความรู้จักกับโปรโตคอล ARP กันก่อนนะครับ
ARP ย่อมาจาก Address Resolution Protocol การทำงานง่ายๆ ของ ARP?มี 2 ขั้นตอน คือ

เครื่องที่ต้องการสอบถาม MAC Address โดยการส่ง ARP Request ซึ่งประกอบด้วย MAC Address และ IP Address ของตนเอง และ IP Address ของเครื่องที่ต้องการทราบ MAC Address ส่วน MAC Address [...]]]></description>
			<content:encoded><![CDATA[<p>ARP Spoofing และ?ARP Poisoning เป็นการโจมตีเครือข่ายรูปแบบหนึ่ง โดยการส่ง MAC Address ปลอมไปให้เครื่องต่างๆ ในระบบเครือข่าย ผมขอเรียกมันว่าอุปกรณ์ในเครือข่ายดีกว่า เพราะว่ามันสามารถที่จะหลอกอุปกรณ์ทุกชนิดในระบบเครือข่าย?โดย MAC Address ที่ส่งไปนั้น จะทำให้อุปกรณ์ต่างๆ ติดต่อไปยัง MAC Address ปลอมที่ส่งมา ส่งผลให้อุปกรณ์นั้น ไม่สามารถใช้งานระบบเครือข่ายได้</p>
<p>ก่อนอื่นเรามาทำความรู้จักกับโปรโตคอล ARP กันก่อนนะครับ<br />
ARP ย่อมาจาก Address Resolution Protocol การทำงานง่ายๆ ของ ARP?มี 2 ขั้นตอน คือ</p>
<ol>
<li>เครื่องที่ต้องการสอบถาม MAC Address โดยการส่ง ARP Request ซึ่งประกอบด้วย MAC Address และ IP Address ของตนเอง และ IP Address ของเครื่องที่ต้องการทราบ MAC Address ส่วน MAC Address ปลายทางนั้น จะถูกกำหนดเป็น FF:FF:FF:FF:FF:FF ซึ่งเป็น Broardcast Address เพื่อให้ ARP Request ถูกส่งไปยังเครื่องทุกเครื่องที่อยู่ในเครือข่ายเดียวกัน</li>
<li>เครื่องที่มี IP Address ตรงกับที่ระบุใน ARP Request จะตอบกลับมาด้วย ARP Reply ซึ่งประกอบด้วย MAC Address และ IP Address ของตนเองเป็นผู้ส่ง และใส่ MAC Address และ IP Address ของเครื่องที่ส่งมาเป็นผู้รับ ARP Reply</li>
</ol>
<p>สำหรับการโจมตีนั้น เครื่องที่โจมตีจะส่ง ARP Request โดยระบุ MAC Address ของ Gateway ที่ผิดๆ ไป ทำให้เครื่องที่ถูกโจมตีรำ MAC Address ไปอัพเดต ARP Table และยังส่ง MAC Address ปลอมไปยัง Gateway ด้วย ทำให้ Gateway อัพเดต ARP Table ที่ผิดเช่นกัน ส่งผลให้การ Broadcast ไปยังเครื่องต่างๆ ไม่ถูกต้อง ทำให้เครื่อง Client นั้นๆ ไม่สามารถใช้งานระบบเครือข่ายได้ในที่สุด โดยการโจมตีนั้นเครื่องที่โจมตีจะส่ง ARP Reqest เป็นจำนวนมาก</p>
<p style="text-align: center; width: 100%;"><a href="http://www.walanchai.info/wp-content/uploads/2008/11/arp-spoof.jpg"><img class="size-medium wp-image-14 aligncenter" style="margin: auto;" title="ARP Spoofing" src="http://www.walanchai.info/wp-content/uploads/2008/11/arp-spoof-300x170.jpg" alt="" width="300" height="170" /></a></p>
<p><strong>วิธีแก้ไข</strong></p>
<p>วิธีแก้ไขเบื้องต้น ก็คือ กำหนด Static MAC Address ของ Gateway ครับ โดยเราจะต้องทราบ MAC Address ของ Gateway ก่อน จากนั้น เปิด command prompt แล้วพิมพ์ว่า</p>
<blockquote style="width: 100%;">
<p style="text-align: center; width: 100%;">arp -s [IP Address] [MAC Address]</p>
</blockquote>
<p>เช่น</p>
<blockquote style="width: 100%;">
<p style="text-align: center; width: 100%;">arp -s 192.168.1.1 00-AA-00-62-C6-09</p>
</blockquote>
<p>แต่จากการทดลองของผมนะครับ มันไม่สามารถใช้ได้จริง เพราะว่า Static MAC Address นั้น จะตั้งได้เฉพาะเครื่องของเรา แต่เนื่องจาก ARP Spoofing จะโจมตี?Gateway ด้วย จึงทำให้ Gateway?ได้รับ MAC Address?ปลอม และส่งข้อมูลไปยัง MAC Address ปลอมแทนครับ</p>
<p>หลายๆท่านอ่านมาถึงตรงนี้ คงจะมีคำถามเกิดขึ้น แล้วจะเขียนวิธีแก้ไขทำไมหว่า?? ยังมีครับ ยังมีวิธีแก้ไข แต่ขอเอาไว้ต่อตอน 2 นะครับ ภาคนี้มีแต่</p>
<blockquote><p>มาตรา? 10 ?ผู้?ใด?กระทำ?ด้วย?ประการ?ใด?โดย?มิชอบ? ?เพื่อ?ให้?การทำ?การของระบบคอมพิวเตอร์ของ?ผู้?อื่น?ถูกระงับ? ?ชะลอ? ?ขัดขวาง? ?หรือ? ?รบกวนจน?ไม่?สามารถ?ทำ?งานตามปกติ?ได้?ต้อง?ระวางโทษจำ?คุก? ?ไม่?เกินห้าปี? ?หรือ?ปรับ?ไม่?เกินหนึ่งแสนบาท? ?หรือ? ?ทั้ง?จำ?ทั้ง?ปรับ</p></blockquote>
<p>ไว้เจอกันตอนต่อไปครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walanchai.info/2008/arp-spoofing-arp-poisoning/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

