Character Set

And that is the mysql table

CREATE TABLE IF NOT EXISTS tevents (
event_id int(11) NOT NULL auto_increment,
event_name varchar(255) character set greek NOT NULL,
start_date datetime NOT NULL,
end_date datetime NOT NULL,
type int(11) NOT NULL,
PRIMARY KEY (event_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

have tried the following as well but it does not work either

CREATE TABLE IF NOT EXISTS tevents (
event_id int(11) NOT NULL auto_increment,
event_name varchar(255) NOT NULL,
start_date datetime NOT NULL,
end_date datetime NOT NULL,
type int(11) NOT NULL,
PRIMARY KEY (event_id)
) ENGINE=MyISAM DEFAULT CHARSET=greek;

I believe if I add

      mysql_query('set character set greek',$res);
mysql_query("SET NAMES 'greek'",$res);

to the insert command It will be able to do it correctly

but I do not know where to find the insert command

The lines from which connector file starts

$res=mysql_connect($server, $user, $pass); mysql_select_db($db_name); mysql_query('set character set greek',$res); mysql_query("SET NAMES 'greek'",$res);

executed for each call, including the dataprocessor calls, so probably it is already executed

connector/db_common.php

public function insert($data,$source){ $sql=$this->insert_query($data,$source); $this->query($sql); $data->success($this->get_new_id()); }

This is where insert sql command is generated and executed.

Extracting from the log file

INSERT INTO tevents(start_date,end_date,event_name,type) VALUES (‘2010-08-18 09:50’,‘2010-08-18 12:30’,‘Νέα εγγραφή’,‘1’)

and executing it on the mysql server the entry get insereted perfectly.

I really do not get it. Are we sure that there is no conversion anywhere ? Because I can not give any other explanation. If the data in the log file is what it is send to the server then I am failing to understand where is the problem.

Thnks a lot for the help Stanislav realy appreciate the effort but there must be a reasonable explanation for that.

is there a way to display the full insert command just before it is send to the server, that might be the only way to understand what short of data are send.

I am almost convienced of that because when something is written in the lightbox, when it is saved (press save button) it is displayed correctly until a refresh is made. Which means that during the actual save to the database something is changed.

Log taken exactly before execution mysql_query command, so command is not changed after that.
The problem may be related to the connection configuration and PHP mysql driver.

Maybe there is some other SQL command like “set names” but for insert operations, not sure. Will look for more info, but currently I have not any ideas as well.

By the way, which version of PHP and MySQL you are using?

PHP Version 5.2.13

Mysql 5.1

Just to clarify the issue here are some extracts






Last image