如何在PHP中将希伯来语值插入到MySQL数据库中 [英] How to insert an hebrew value into a mysql db in php

查看:47
本文介绍了如何在PHP中将希伯来语值插入到MySQL数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个希伯来语值插入到我的mysql数据库中,而不是希伯来语值看起来像那样.

I'm trying to insert an hebrew value into my mysql db, instead of hebrew the values looks like that.

ש×גש×"כעש×"

ש×"גש×"כעש×"

该表的排序规则默认为latin1_swedish_ci,我也尝试将其更改为utf-8_general_ci,hebrew_bin,hebrew_general_ci,但结果仍然相同.

The collation of the table is latin1_swedish_ci by default, I tried also to change to utf-8_general_ci, hebrew_bin, hebrew_general_ci but the result is still the same.

在我的代码中,我当然使用meta标签来配置字符集:

In my code I'm using of course the meta tag to configure the charset:

<meta charset="UTF-8">

在我的php查询之前,我添加了以下行:

And before my php query I added this line:

mysql_query("SET NAMES utf8");

我正在phpmyadmin中查看结果.

I'm viewing the result in the phpmyadmin.

推荐答案

检查归类连接:

show variables like '%collation%'

这篇关于如何在PHP中将希伯来语值插入到MySQL数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆