2012年2月28日 星期二

MySQL PDO 範例說明

發現一個講解得不錯的 PDO 網

http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html

網頁最後一句話,我覺得是所有教育者應該參考的。

I would rather see a sermon than hear one any day. I'd rather have you walk with me, than merely point the way. The eye is a more ready pupil than ever was the ear, good advice is often confusing, but example is always clear.

mssql 轉 mysql 前使用 iconv('big-5', 'utf-8', "$str")

將 mssql 讀出來之後,轉寫到 mysql 前,使用 iconv('big-5', 'utf-8', "$str");
即可將編碼轉成 utf-8 格式。

2011年12月17日 星期六

Youtube iframe 遮住下拉選單

Youtube iframe 遮住網頁的下拉選單,只要在後面加上 "wmode=opaque" 就可以了

例如:

<iframe width="420" height="315" src="http://www.youtube.com/embed/Wt3gTest?wmode=opaque&rel=0" frameborder="0" allowfullscreen></iframe>

2011年9月2日 星期五

刪除怪檔名檔案

不小心 touch 了一個檔案名稱是 -L,由於前面的減號剛好是 Unix Like 系統指令下參數用的,所以用 rm -rf -L 怎麼刪也刪不掉。rm -rf "-L" 也不行。Google 也 Google  不出答案來。試過幾個指令之後原來是加上路徑,這樣就可以刪掉了。



#rm ./-L

2011年9月1日 星期四

phpmyadmin utf8 中文亂碼

我是這麼做的

1. 載入utf8 檔案時選 CVS 而不選 CVS LOAD DATA
2. 有中文的欄位,連線校對選 utf8_unicode_ci


2011年6月8日 星期三

DNS/BIND named: the working directory is not writable

裝完 BIND 出現

"named: the working directory is not writable"

FreeBSD:

到 /etc/mtree/BIND.chroot.dist
把 /set type=dir uname=root gname=wheel mode=0755
改成  /set type=dir uname=bind gname=wheel mode=0755
重跑 /etc/rc.d/named restart

參考連結:http://slaptijack.com/system-administration/dnsbind-issue-named-the-working-directory-is-not-writable/