Ms7 Search
Google 搜尋 翻譯
calendar
« 七月 2025 »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
近期文章
文章分類
網站連結
Syndicate

« | »

mysql 插入數據時出現 Incorrect string value: '\xF0\x9F...' for column 'name' at row 1的異常

2020-08-12 @ 17:31 in PHP, JavaScript, Sql

最近在用 Excel 檔匯入資料時,顯示 Error , 轉成 Csv 再匯入就正常, 查網,原來是有些 Utf8 圖型或造字用到 4碼(含)以上,而 Mysql 的 Utf8 內定3碼,解決方法網上是將內定 Utf8 3碼改成 character-set-server=utf8mb4 4碼,資料表也要更改(https://blog.csdn.net/m0_37983376/article/details/79224862)有修改方法,可是我改後無效,不知少了什麼,後來想,那些造字沒有顯示對網頁來說沒有那麼重要,所以想到一個取巧的方式,將這些字丟掉不存在就可以了,方法是,在 php 程式,將 utf8 轉成 big5 ,那些字就會用 "?" 代替,再將它轉回 Utf8 給網頁用,再樣那些字就給轉不見了, Csv 不用轉,因為它本來就是 big5,程式自動轉成 Utf8 ,指令如下:

if($type != "csv")            //不是csv檔,$str 轉big5再轉回Utf-8,排除 utf8 4碼以上字及造字,mysql utf8 內定三碼 
      {
       $str5 = mb_convert_encoding($str, "big5" , "UTF-8");
       $str = mb_convert_encoding($str5, "UTF-8", "big5");
       }

迴響

mysql 插入數據時出現 Incorrect string value: \xF0\x9F... for column name at row 1的異常 | 豬窩

Verry nice post. I just stuymbled upon your weblog annd wiswhed to say that I have reaally enjoyed surfjng around your blog posts.
In any case I will bbe subscribing to your
feed and I hope yyou write agaiin soon!

作者 xnxxhub.win @ 02:10, 2025-07-05

mysql 插入數據時出現 Incorrect string value: \xF0\x9F... for column name at row 1的異常 | 豬窩

Youu really makle it seem sso easy with your preesentation buut I find this topic tto be really someting which I think I would
never understand. It seems too complicated and very brod ffor me.

I'm looking fotward foor your next post, I wijll tryy to geet the haqng of it!

作者 novoporno @ 05:57, 2025-07-07

mysql 插入數據時出現 Incorrect string value: \xF0\x9F... for column name at row 1的異常 | 豬窩

We absolutely love yourr blog and fund almoswt all oof your post's tto be precisely wbat I'm lookingg for.
Dooes oone ofer guestt writerrs tto wrkte content foor yourself?

I wouldn't mjnd publishing a pist orr elaborating on a few of thhe subjects you write about here.

Again, awesome blog!

作者 phimguru.com @ 14:41, 2025-07-07

mysql 插入數據時出現 Incorrect string value: \xF0\x9F... for column name at row 1的異常 | 豬窩

Wow, wonderful blig layout! Howw long havce yyou been blogging for?
yoou made blogging look easy. Thhe ovewrall look of
yokur web sijte is great, let alone thhe content!

作者 xnxxx.page @ 10:05, 2025-07-09

mysql 插入數據時出現 Incorrect string value: \xF0\x9F... for column name at row 1的異常 | 豬窩

Excellent good from you, man. I have understand you stuff
previous too andd you're just extremely wonderful.

I eally like what yyou havee acquired here, certaiinly like what you are stating aand tthe wway iin whjch youu sayy it.
You makke it enjioyable annd yyou still caee for too
keep it smart. I ccan not wait to read much more from you.
Thiss iis really a tremndous wweb site.

作者 bokep-xxx.com @ 07:09, 2025-07-16
«上一篇   1 2 3 ... 32 33 34 35 36 37 38  下一篇»
發表迴響
 authimage