PDA

View Full Version : Solved! - help with hebrew in mysql!


shedokan
11-07-2007, 12:16 AM
when I try to get info that writen in hebrew from mysql I get ??? instead of hebre

guelphdad
11-07-2007, 02:51 PM
did you change your character set? also you will need to change the collation to get the correct sorting order for that alphabet.

check the manual for details.

shedokan
11-07-2007, 03:56 PM
I'm using freemysql.net and I don't know where to search the manual can you give me links or tell me how to do it? please

guelphdad
11-07-2007, 05:40 PM
http://dev.mysql.com/doc/refman/5.0/en/charset.html

shedokan
11-07-2007, 08:35 PM
you don't understand I have only access to phpmyadmin.
can you give me the code I need because I'm new to this mysql stuff

Fumigator
11-07-2007, 08:49 PM
Something tells me you didn't read anything in the manual that Guelphdad gave a link to. Otherwise you would have seen this page:

http://dev.mysql.com/doc/refman/5.0/en/charset-database.html

shedokan
11-07-2007, 11:34 PM
I've read it but I don't understand it!

guelphdad
11-08-2007, 01:59 AM
There is no code to give you. You need to change the character set to accept Hebrew characters. You then need to change the collation to order those characters properly.
You can change this for your entire database if you have access to the config file, or you can change this on a table by table basis.

You are limiting yourself if you don't use the SQL tab in phpmyadmin. You can perform ANY mysql operation when using that tab.

You still need to read the manual to understand why you need to change those things though.

shedokan
11-08-2007, 03:56 PM
Solved!!:
what I did is I set the table I needed to utf8 and all the rows in it to utf8 the added this to the connection script:mysql_query("SET NAMES 'utf8'");
hope this will help if someone will need it :D

shedokan
11-08-2007, 05:01 PM
I solved the problem of getting from mysql but now when I put to mysql it put's: ???'s instead of hebrew words
the table is setup for hebrew so I think the problem is from the php side

guelphdad
11-08-2007, 05:29 PM
are you sure it inputs incorrect characters or is only displaying them that way in your browser? Make sure you have the proper character set showing on your web page too.

shedokan
11-08-2007, 06:20 PM
I have the proper character set the problem is with the query to add to mysql hebrew characters

guelphdad
11-08-2007, 06:32 PM
show your query and a sample insert statement

shedokan
11-08-2007, 09:59 PM
here is an example of a query: "INSERT INTO news (text, date) VALUES ('$_GET[text]', '$_GET[date]')"

here is an example of $_GET[text]:"הנה כמה חדשות"


here is an example of $_GET[date]:"נכתב ביום חמישי ה-8 לנובמבר 21:58:31"

shedokan
11-09-2007, 12:06 AM
I added this before the query:
mysql_query("SET NAMES 'hebrew'");

guelphdad
11-09-2007, 02:05 AM
Solved!!:
what I did is I set the table I needed to utf8 and all the rows in it to utf8 the added this to the connection script:mysql_query("SET NAMES 'utf8'");
hope this will help if someone will need it :D

why use utf8 for hebrew characters? Shouldn't you be using hebrew as your character set?