mysql不能存字母,使用不常見的字母/符號時,MySql數據庫不能正確存儲數據

I have a simple form that sends (via php) some variables to a mySql database.

我有一個簡單的表單,通過PHP發送一些變量到mySql數據庫。

The problem is that it's focused to Portuguese audience, and we use several unusual letters, like "ç" and "ã". Whenever someone sends data with those letters, the result is very "garbled" in the phpMyAdmin.

問題是它專注於葡萄牙觀眾,我們使用幾個不尋常的字母,如“ç”和“ã”。每當有人用這些字母發送數據時,phpMyAdmin中的結果都非常“亂碼”。

Quick example for a field would be "Escola de Condução Clássica" apears as "4573636f6c6120646520636f6e6475c383c2a7c383c2a36f20436c617373696361" in the phpMyAdmin.

一個字段的快速示例是“EscoladeTransçãoClássica”,在phpMyAdmin中為“4573636f6c6120646520636f6e6475c383c2a7c383c2a36f20436c617373696361”。

I tried setting the collation to "utf8_bin", with no avail.

我嘗試將排序規則設置為“utf8_bin”,但沒有用。

Any ideias?

Thank you.

EDIT: Field type is varchar(30) and charset shows as "utf8".

編輯:字段類型是varchar(30),字符集顯示為“utf8”。

2 个解决方案

#1

0

ALTER TABLE mytable CONVERT TO CHARACTER SET utf8

ALTER TABLE mytable CONVERT TO CHARACTER SET utf8

#2

0

I found out the problem. Turns out I just needed to call my hosting to change the php setting. I wish I had tried this beforehand, but I though it was something wrong on my end. Also, it makes no sense for them to have another encoding other than UTF-8, considering its a Portugal (european) based hosting.

我發現了問題。事實證明我只需要調用我的主機來更改php設置。我希望我事先嘗試過這個,但是我覺得這樣做有些不對勁。此外,考慮到它的葡萄牙(歐洲)主機,它們沒有其他編碼而不是UTF-8。

Anyway, if someone gets this error, try asking the hosting about which encoding is used in the php setting (it should have been UTF-8 in my case, might be diferent for you).

無論如何,如果有人收到此錯誤,請嘗試詢問托管在php設置中使用了哪種編碼(在我的情況下應該是UTF-8,對您來說可能不同)。

And yes, this problem took a while because I eventually ignored it, but I had to do something similar recently in a diferent site (using the same hosting).

是的,這個問題需要一段時間,因為我最終忽略了它,但最近我不得不在不同的網站(使用相同的托管)做類似的事情。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/440458.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【HDU - 6184】Counting Stars(三元环计数,二分,优化暴力,O(m*sqrt(m)),图论)

题干: Little A is an astronomy lover, and he has found that the sky was so beautiful! So he is counting stars now! There are n stars in the sky, and little A has connected them by m non-directional edges. It is guranteed that no edges connec…

php 取oracle图片,在PHP中将图片存放ORACLE中_php

我这里提供一个用php操纵blob字段的例子给你,希望能有所帮助!这个例子是把用户上传的图片文件存放到BLOB中。假设有一个表,结构如下:CREATE TABLE PICTURES (ID NUMBER,http://www.gaodaima.com/44856.html在PHP中将图片存放oracl…

【HDU - 6183】Color it(CDQ分治 或 动态开点线段树)

题干: Do you like painting? Little D doesnt like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program to maintain following operations. The speci…

php create()方法,ThinkPHP中create()方法自动验证实例

ThinkPHP中create()方法自动验证实例2020-06-16 04:24:32自动验证是ThinkPHP模型层提供的一种数据验证方法,可以在使用create创建数据对象的时候自动进行数据验证。原理:create()方法收集表单($_POST)信息并返回,同时触发表单自动验证&#x…

【蓝桥杯官网试题 - 历届试题】格子刷油漆(dp)

题干: 问题描述 X国的一段古城墙的顶端可以看成 2*N个格子组成的矩形(如下图所示),现需要把这些格子刷上保护漆。   你可以从任意一个格子刷起,刷完一格,可以移动到和它相邻的格子(对角相邻也…

php 解析 ini文件,php解析.ini文件

1.myphp.ini文件autostart false font_size 12font_color red$string[access] 进入;$string[accesshelp] 进入帮助;$string[accesskey] 进入验证 {$a};$string[accessstatement] 进入声明;$string[activitynext] 下一个活动;$string[activityprev] 前一个活动;$string…

【CSU - 1004】Xi and Bo(并查集,裸题)

题干: Bo has been in Changsha for four years. However he spends most of his time staying his small dormitory. One day he decides to get out of the dormitory and see the beautiful city. So he asks to Xi to know whether he can get to another bus …

oracle软件静默安装程序,【oracle】静默安装 oracle 11gr2

【序言】oracle 提供了静默安装方法在不适用图形界面的情况下安装 oracle 软件 ,创建db,配置netca,快速完成oracle 的部署。在以下情形中可以使用静默安装a OUI 的 GUI 界面远程交互比较慢 .b 数据库服务器无法使用图形界面访问.c 批量部署oracle (标准环境统一情况下可以使用o…

【2050 Programming Competition - 2050 一万人码 】非官方部分题解(HDU)

1001 开场白 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 12147 Accepted Submission(s): 3502 Problem Description 来自世界各地的年青人在 https://2050.org.cn 握手团聚, 他们是航空…

oracle数据库建表视频,Oracle数据库的创建表全

CREATE TABLE "库名"."表名" ("FEE_ID" VARCHAR2(10 BYTE) constraint ABS_FEE_ID primary key,--主键,必须要有序列"BANK_GROUP_ID" VARCHAR2(5 BYTE),"ABS_PRODUCT_ID" VARCHAR2(30 BYTE))TABLESPACE "表…

oracle的脚本语言是什么意思,Oracle中的sql脚本语言中的循环语句介绍

--sql脚本语言的循环介绍&#xff1a;--1.goto循环点。declarex number;beginx:0;--变量初始化&#xff1b;<>--设置循环点。x:x1;dbms_output.put_line(x);--循环体if x<9 then --进入循环的条件。goto repeat_loop; --用goto关键字引导进入循环。end i…

【poj题集整理】【存下来并不会看】

主要是整理起来自己用的。网上有多个版本。 初级: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算…

oracle排名怎么去除空值影响,Oracle排序中null值处理方法讲解

1、缺省处理oracle在order by 时缺省认为null是最大值&#xff0c;所以如果是asc升序则排在最后&#xff0c;desc降序则排在最前2、使用nvl函数nvl函数可以将输入参数为空时转换为一特定值&#xff0c;如nvl(employee_name,’张三’)表示当employee_name为空时则返回’张三’&a…

【ZOJ - 3870】Team Formation(异或,思维)

题干&#xff1a; For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student. He has found that if two students with skill lev…

oracle dump enq hw,经典故障分析 - ASSM引发的索引争用与 enq HW -contentio

作者介绍&#xff1a;孙加鹏 云和恩墨技术顾问六年Oracle技术顾问经验&#xff0c;所服务的行业包括电信运营商、金融业、制造业等。擅长Oracle的故障诊断、高可用架构、升级迁移等。目前主要服务于上海金融类客户。1故障概述2017年07月24日11:58左右&#xff0c;客户核心数据库…

【ZOJ - 3946】Highway Project(最短路子图,维护双权值,贪心,最小树形图)

题干&#xff1a; Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the capital as fast as possible. Thus, he proposed the highway project. The Marjar Empire has N cities (including…

oracle 主键约束复制,Oracle主键及约束

Oracle主键Primary Key包含非空约束及唯一约束。添加主键的语句alter table table_nameadd constraint cons_name primary key(col_name);查看主键是否被创建成功select dbms_metadata.get_ddl(‘OBJECT_TYPE‘,‘NAME‘,‘SCHEMA‘) from dual;OBJECT_TYPE (TABLE,PARTITION,I…

【ZOJ - 3956】Course Selection System(01背包)

题干&#xff1a; There are n courses in the course selection system of Marjar University. The i-th course is described by two values: happiness Hi and credit Ci. If a student selects m courses x1, x2, ..., xm, then his comfort level of the semester can be…

oracle 账户 锁定 密码忘记了,Oracle System密码忘记 密码修改、删除账号锁定lock

运行cmd命令行录入 sqlplus /nolog 无用户名登录conn /as sysdba 连接到数据本地数据alter user system identified by password; 修改System 密码 为passwordD:\oracle\ora92\bin>sqlplus /nologSQL*Plus: Release 9.2.0.1.0 - Production on 星期四 8月 16 11:32:22 …

【计蒜客 - 2019南昌邀请赛网络赛 - K】MORE XOR(数学,找规律,打表)

Given a sequence of nn numbers a_1, a_2, \cdots, a_na1​,a2​,⋯,an​ and three functions. Define a function f(l,r)f(l,r) which returns \oplus a[x]⊕a[x] (l \le x \le rl≤x≤r). The \oplus⊕ represents exclusive OR. Define a function g(l,r)g(l,r) which r…