jQuery 取得元素名稱
jQuery
1.6以前使用.attr('tagName')取得名稱,
1.6以後使用.prop('tagName')取得名稱.
參考
jQuery Attr: http://api.jquery.com/attr/
jQuery Prop: http://api.jquery.com/prop/
1.6以前使用.attr('tagName')取得名稱,
1.6以後使用.prop('tagName')取得名稱.
參考
jQuery Attr: http://api.jquery.com/attr/
jQuery Prop: http://api.jquery.com/prop/
MySQL - mysqldump single column
公司突然要求匯出某個table的某個column
mysqldump又不支援只輸出一個欄位,
山不轉路轉, 先將要輸出的欄位生成新表在dump即可~
# 假如資料表已存在刪除
DROP TABLE IF EXISTS `_database_`.`_new_table_`;
# 新增資料表
CREATE TABLE `_database_`.`_new_table_`
SELECT `_column_`
FROM `_database_`.`_src_table_`
WHERE ...
# 將資料dump到/tmp底下, 因為tmp寫入不受權限限制
mysqldump -u root -p -t -T/tmp --fields-enclosed-by=\" --fields-terminated-by=, --databases _databases_ --tables _new_table_;
匯出後會在/tmp底下找到2個檔
_new_table_.sql
_new_table_.txt
mysqldump又不支援只輸出一個欄位,
山不轉路轉, 先將要輸出的欄位生成新表在dump即可~
# 假如資料表已存在刪除
DROP TABLE IF EXISTS `_database_`.`_new_table_`;
# 新增資料表
CREATE TABLE `_database_`.`_new_table_`
SELECT `_column_`
FROM `_database_`.`_src_table_`
WHERE ...
# 將資料dump到/tmp底下, 因為tmp寫入不受權限限制
mysqldump -u root -p -t -T/tmp --fields-enclosed-by=\" --fields-terminated-by=, --databases _databases_ --tables _new_table_;
匯出後會在/tmp底下找到2個檔
_new_table_.sql
_new_table_.txt
CodeIgniter 單一網址 多語系
看Apple用了/tw/來代取代tw.apple.com
省去了買網址的費用, 是一個很不錯的設計,
CI本身就提供Route的功能, 在參考網友的分享,
讓http://xxx.xxx/tw/可以實現
$route['([a-zA-Z]{2})/?'] = 'welcome';
$route['([a-zA-Z]{2})/(:any)'] = '$2';
參考來源: 生活大小事
訂閱:
文章 (Atom)