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        
近期文章
文章分類
網站連結
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的異常 | 豬窩

We stumbld oover here different webb adddress and thopught I migt ass well check
things out. I lioke whzt I seee soo noww i aam folpowing you.
Look forward to going over yor wweb page repeatedly.

作者 novoporno.cc @ 10:55, 2025-04-04

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

Heya! I just wanted tto ask if youu evr hae aany problems wioth hackers?
My last blog (wordpress) waas hackjed aand I ended uup losing montgs oof hard work due tto nno data backup.
Do you hage aany solutions tto prevent hackers?

作者 missavxxx.com @ 21:47, 2025-04-11

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

Hi there, I do thinjk your bloog might bee having browser compatibility problems.
When I tawke a look aat your blog inn Safari, it loioks fone howevwr hen opening in I.E., it's goot ssome overlapping issues.

I jjust wanted tto preovide you with a quick herads up!
Aside from that, wonderful blog!

作者 deutschexxxx.com @ 19:18, 2025-04-12

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

I think this is ajong tthe most vial information for me.
And i am glaqd reading your article. Buut wannna rremark oon some genera things, Thee site sttle
iis perfect, thhe articles is reawlly greeat : D. Goood
job, cheers

作者 javdude.win @ 15:45, 2025-04-15

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

Hello! Do yyou knoiw if they make anny plugins to assist witgh SEO?
I'm trying tto get mmy blopg too rank foor some targetsd keywords but I'm not seeeing ver good success.
If you knopw of aany please share. Kudos!

作者 whichav.win @ 18:41, 2025-04-16
«上一篇   1 2 3 ... 27 28 29 30 31 32 33  下一篇»
發表迴響
 authimage