<?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>สุดเดช บล๊อก &#187; Programming</title>
	<atom:link href="http://blog.sudej.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sudej.com</link>
	<description>ก็เวลายังไม่เดินเป็นเส้นตรง แล้วความรักที่มั่นคงจะมีจริงไหม?</description>
	<lastBuildDate>Tue, 07 Sep 2010 10:26:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>forget mySQL root password</title>
		<link>http://blog.sudej.com/2010/07/forget-mysql-root-password/</link>
		<comments>http://blog.sudej.com/2010/07/forget-mysql-root-password/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 08:31:22 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[forget]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=1048</guid>
		<description><![CDATA[หายหน้าไปน๊านนาน หลายท่านคงนึกว่าคนเขียน ม่องไปล่ะ ป่าวครับไปเตรียมตัวกับหุ้นส่วน(เพื่อนกาก) เตรียมเปิด กิจการที่ถนัด กันอยู่ ซักพักคงได้เห็นกันวันนี้ก็มีปัญหา แล้วก็หาข้อมูลจนทำได้เลยนำมาให้เพื่อน ๆ ดูน่ะครับ เป็นปัญหาของตัว mysql ที่มีคนแย่งไป (ได้ยังไงไม่รู้) เลยต้องไปเอาคืนมาเพื่อให้มันทำงานได้ปกติสุข วันนี้เลยเป็นวันที่ แจ่มอุราอีกวัน ทำงานได้อย่างฟลุ๊ก ๆ  จัดไปลุ๊ยยย เพิ่ม ลงไปในไฟล์ my.cnf ตามตัวอย่าง [mysqld] skip-grant-table จากนั้นให้ restart service mysql ต่อด้วยคำสั่ง mysqladmin -u root flush-privileges password &#34;$password&#34; จากนั้นเข้าไปที่ mysql โดยการพิมพ์ mysql พอเข้ามาใน mysql แล้ว ให้เลือก database mysql โดยคำสั่ง use mysql ตามด้วยสองคำสั่งนี้ UPDATE user SET [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2010/07/forget-mysql-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class Delete MySQL</title>
		<link>http://blog.sudej.com/2009/07/class-delete-mysql/</link>
		<comments>http://blog.sudej.com/2009/07/class-delete-mysql/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 12:14:40 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=751</guid>
		<description><![CDATA[จากครั้งที่แล้วมา ผมเคยได้ เสนอ การใช้ class เพื่อติดต่อฐานข้อมูล จากลิงค์นี้น่ะคับ class db วันนี้ผมจะนำเสนอ เกี่ยวกับการ ลบ ข้อมูลในตารางออก โดย ที่มี ID เกี่ยวข้องกัน 1 : 1 relation มาดูโค้ดของ การลบ ก่อนคับ โค้ดตรงนี้ ให้นำ ไปใส่ไว้ใน class อันที่แล้วก่อนน่ะคับ class db function del($table=&#34;table&#34;,$where=&#34;where&#34;){ $sql=&#34;DELETE FROM &#34;.$table.&#34; WHERE &#34;.$where; if (mysql_query($sql)){ return true; }else{ $this-&#62;_error(); return false; } } จากนั้นก็มาเขียนโค้ดในหน้าใหม่ คับ $sql=$db-&#62;select_query(&#34;show tables;&#34;); while(list($tables_name)=$db-&#62;fetch($sql)){ $tables_name; $db-&#62;del($table_name,&#34;model_id [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/07/class-delete-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php read file and directory</title>
		<link>http://blog.sudej.com/2009/06/php-read-file-and-directory/</link>
		<comments>http://blog.sudej.com/2009/06/php-read-file-and-directory/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 16:22:01 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[file]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=723</guid>
		<description><![CDATA[วันนี้ก็มาแจกโค้ดกันอีกแ้ล้วน่ะคับพี่น้อง เรื่องของการ ใช้ PHP เข้าไป อ่านไฟล์ และ Directory น่ะคับ โ้ค้ดก็ตามนี้คับผม &#60;? $i=1; $countdir=0; $uncountdir=0; if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { $color=($i%2==0)?&#34;#999999&#34;:&#34;#000000&#34;; $number=filesize($file)/1024; $size=number_format($number,'2','.',','); if($size&#60;&#34;1000&#34; &#38;&#38; $file!==&#34;images&#34; &#38;&#38; $file!==&#34;css&#34; &#38;&#38; $file!==&#34;index.php&#34; &#38;&#38; $file!==&#34;sudej&#34;){ // กำหนดไม่เอาไฟล์แสดง if ($file != &#34;.&#34; &#38;&#38; $file != &#34;..&#34;) { echo &#34;&#60;a href=\&#34;$file\&#34;&#62;$file&#60;/a&#62;&#38;nbsp;$size&#38;nbsp;KB&#34;; $i++; $countdir++; } [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/06/php-read-file-and-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class insert comma</title>
		<link>http://blog.sudej.com/2009/04/class-insert-comma/</link>
		<comments>http://blog.sudej.com/2009/04/class-insert-comma/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 14:57:26 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=587</guid>
		<description><![CDATA[คลาสนี้จะรับค่าของ อาร์เรย์เข้ามาหลาย ๆ จำนวนแล้ว ตัวสุดท้ายจะไม่มีคอมม่า ตัวอย่างข้อมูล : ABCD result : A,B,C,D &#60;? class class_insert_comma{ static function read_array($read){ foreach($read as $key =&#62; $val){ echo $val; } } public function change_value($value,$compare_array){ foreach($value as $name =&#62; $val){ if($val){ $file_array[]=$compare_array[&#34;$val&#34;]; } } $file_array=$this-&#62;insert_comma($file_array); return($file_array); } private function insert_comma($value_array){ $uncomma=end($value_array); foreach($value_array as $name){ if($uncomma == $name){ $file_c[]=$name; }else{ $file_c[]=&#34;$name , [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/04/class-insert-comma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>class upload file</title>
		<link>http://blog.sudej.com/2009/03/class-upload-file/</link>
		<comments>http://blog.sudej.com/2009/03/class-upload-file/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 06:57:12 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=459</guid>
		<description><![CDATA[วันนี้มาแจก อีกแล้วครับ คลาส อัพโหลดไฟล์ ดูโค้ดและ ก็ภาพการทำงานล่ะกันน่ะคับ &#60;? ### class upload version 2 ##  author sudej.com define(&#34;PATH&#34;,&#34;images/&#34;); define(&#34;FILE_LIMIT&#34;,&#34;194304&#34;); //4194304 = 4MB class upload{ public function check_file_to_upload($file){ $file_name = $_FILES[&#34;userfile&#34;][&#34;name&#34;]; $file_size = $_FILES[&#34;userfile&#34;][&#34;size&#34;]; $file_temp = $_FILES[&#34;userfile&#34;][&#34;tmp_name&#34;]; $file_err = $_FILES[&#34;userfile&#34;][&#34;error&#34;]; echo &#34;&#60;div style=\&#34;padding: 4px;\&#34;&#62;ข้อมูลทั่วไป ของไฟล์ที่ทำการอัพโหลด&#60;/div&#62; &#60;ul&#62; &#60;li&#62;ชื่อไฟล์ : &#60;span style=\&#34;color:#933\&#34;;&#62;&#34; .$file_name. &#34;&#60;/span&#62;&#60;/li&#62; &#60;li&#62;ชนิด : &#60;span style=\&#34;color:#933\&#34;;&#62;&#34; .$this-&#62;check_file_type($file_name).&#34;&#60;/span&#62;&#60;/li&#62; &#60;li&#62;ขนาด [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/03/class-upload-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crontab backup database</title>
		<link>http://blog.sudej.com/2009/02/crontab-backup-database/</link>
		<comments>http://blog.sudej.com/2009/02/crontab-backup-database/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 08:16:55 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[crontab]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=442</guid>
		<description><![CDATA[จากเมื่อวาน &#60;&#60; คลิ๊กเพื่อดูเรื่องที่ต่อเนื่อง วันนี้จะบอกวิธีการติดตั้ง Crontab กันน่ะคับ เริ่มจากการสร้างไฟล์ Crontab ขึ้นมาก่อนน่ะคับ 15 4 * * * php -q /home/backup/rbackup.php &#62; /dev/null 2&#62;&#38;1 ความหมายของมันก็คือ ทุก ๆ วัน เวลา ตี 4.15 ให้ทำการ รัน สริปต์ ที่ชื่อว่า rbackup.php เมื่อสร้างเสร็จแล้ว คราวนี้ก็มาดูผลการทำงาน ของ script กันน่ะคับ ขอบคุณทุกท่าน ที่ดูแล้ว จะนำไปให้ให้เกิดประโยชน์ต่อไป ขอบคุณทุกท่าน ที่เอาไปใช้แล้วให้เครดิตผม กันลืม crontab filename การนำเอาคำสั่ง crontab เข้ามาจาก ไฟล์อื่น crontab -e แก้ไข crontab ปัจจุบัน crontab [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/02/crontab-backup-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Script Backup Database</title>
		<link>http://blog.sudej.com/2009/02/php-script-backup-database/</link>
		<comments>http://blog.sudej.com/2009/02/php-script-backup-database/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 13:17:59 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[crontab]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=436</guid>
		<description><![CDATA[วันนี้ผมจะมานำเสนอ การ Backup database โดยใช้ php น่ะคับ เป็นการ backup ข้อมูลผ่าน สริปต์ โดยใช้ ตัว crontab ใน Linux เป็นตัวเรียก สริปต์นี้ ใ้ห้ทำงานน่ะคับ วันนี้จะนำเสนอ ในเรื่องของ สริปต์กันก่อนน่ะคัีบ ผมได้ เรียนรู้บางคำสั่ง จาก อาจารย์ เปิ้ล แอบ เซิฟ  และ การโค้ดดิ้ง แนะแนวโดยพี่แม๊กมอไซค์คับ โดยการ backup ในครั้งนี้ เมื่อทำการแบ๊กอัพ เสร็จแล้ว มันจะส่งเมล์ไปบอก ยัง ผู้ดูแลระบบ ในครั้งต่อไปผมจะ นำ คำสั่ง พร้อมกับ ภาพ มาประกอบให้ดูกันน่ะคับ ขอบคุณทุกท่าน ที่ดูแล้ว จะนำไปให้ให้เกิดประโยชน์ต่อไป ขอบคุณทุกท่าน ที่เอาไปใช้แล้วให้เครดิตผม สังคมน่าอยู่เพราะว่ามีคนมีน้ำใจ sp thx[1]: NECTEC [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/02/php-script-backup-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TRUNCATE TABLES ALL</title>
		<link>http://blog.sudej.com/2009/02/truncate-tables-all/</link>
		<comments>http://blog.sudej.com/2009/02/truncate-tables-all/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 12:25:45 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[manage]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[truncate]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=427</guid>
		<description><![CDATA[เมื่อผู้พัฒนา เรื่องเข้าใจ ในการทำงานของ คลาส ดาต้าเบส แล้ว ต่อจากนี้ผมจะเอาตัวที่จัดการ การทำงาน ของ MySQL ตัวหนึ่งมาให้รู้กัน นั้นคือ คำสั่ง TRUNCATE นั้นเองการทำงานของคำสั่งนี่คือการทำให้ Table ที่ทุกสั่งนั้น จะเป็น EMPTY ทั้งหมด ในโปรแกรม phpmyadmin นั้นมีอยู่แล้ว แต่ว่า ผมอยากเขียนขึ้นมาใหม่อ่ะ ขี้เกียจไปเข้ามันช้า มาดูการเขียนกันคับ รูปแบบคำสั่งของมันจะเป็นแบบนี้คับ และ เพิ่มเติมให้อีกอันน่ะคับ นั้นก็คือตัว SHOW TABLES; TRUNCATE TABLE ชื่อเทเบิ้ล; ex TRUNCATE TABLE tbl_model; งั้นมาดูโค้ดที่ผมเขียนกันเลยน่ะคับ ขั้นตอนแรกก็ include ไฟล์ที่ชื่อว่า class.mysql.php เข้ามาก่อนน่ะคับ แ้ล้วไปตั้ง ค่า config ที่ตัว constant กันก่อนคับ ลอง ๆ หาดู [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/02/truncate-tables-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>database class</title>
		<link>http://blog.sudej.com/2009/02/database-class/</link>
		<comments>http://blog.sudej.com/2009/02/database-class/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 11:29:33 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=424</guid>
		<description><![CDATA[เขียนคลาสขึ้นมาเพื่อควบคุมการใช้งาน DATABASE ได้อย่างมีประสิทธิ์ภาพ ขอขอบคุณ พี่แม๊กมอไซค์ สำหรับโค้ดบางส่วนในการพัฒนางานในครั้งนี้ class db{ var $host = DB_HOST; var $database; var $connect_db; var $selectdb; var $db; var $sql; var $table; var $where; public function connectdb($db_name=&#34;database&#34;,$user=&#34;username&#34;,$pwd=&#34;password&#34;){ $this-&#62;database = $db_name; $this-&#62;username = $user; $this-&#62;password = $pwd; $this-&#62;connect_db = mysql_pconnect($this-&#62;host, $this-&#62;username, $this-&#62;password ) or $this-&#62;_error(); $this-&#62;db = mysql_select_db ( $this-&#62;database, $this-&#62;connect_db) or $this-&#62;_error(); mysql_query(&#34;SET [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/02/database-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>การตั้งค่า utf8</title>
		<link>http://blog.sudej.com/2009/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b9%88%e0%b8%b2-utf8/</link>
		<comments>http://blog.sudej.com/2009/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b9%88%e0%b8%b2-utf8/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 11:33:56 +0000</pubDate>
		<dc:creator>สุดเดช</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://blog.sudej.com/?p=248</guid>
		<description><![CDATA[สำหรับท่านที่ เปลี่ยนมาใช้ utf-8 แล้วเกิดปัญหา เวลา Browser เปิดข้อมูลแล้วเกิดปัญหาตัวอักษรไม่แสดงผล ตามที่เราตั้งค่าไว้ ปัญหามันเกิดมาจาก ตัว Content-Type:text/html; ไม่ยอมเรียกค่า ปกติมันออกมา เราก็มีวิธีแก้ปัญหาดังนี้คับ สำหรับคนใช้ Linux fedora, redhat น่ะคับ อับดับแรกก็ไปแก้ไข ไฟล์ที่ชื่อว่า httpd.conf &#60;code&#62;########################## AddDefaultCharset UTF-8 AddCharset ISO-8859-1  .iso8859-1  .latin1 AddCharset UTF-8       .utf8 AddCharset utf-8       .utf8 AddCharset TIS-620      .tis-620        th ########################## สำหรับคนที่ไม่สามารถแก้ไขได้เนื่องจากท่านไม่ Admin ระบบ ก็ให้เขียนไฟล์ .htaccess หรือ htaccess.txt แล้วให้ upload ไปยังที่ directory ที่เก็บไฟล์ไว้ของผมอยู่ที่ htdocs คับ ซึ่งของผมเช่า [...]]]></description>
		<wfw:commentRss>http://blog.sudej.com/2009/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b9%88%e0%b8%b2-utf8/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->