Jump to content

Archived

This topic is now archived and is closed to further replies.

jimath

insert problem

Recommended Posts

[quote]hi everyone!
i have created a table like this:
table: lessons per exam
columns: lesson_id int(11)
            semester int(11)
            name_lesson varchar(120)
            exam_char varchar(30)
            theory int(11)
            lab int(11)
            state int(11)
            state_char varchar(30)

in this table i want to execute this query:
INSERT INTO `lessons_per_exam` VALUES (10, 1, 'Υπολογιστές', 'Α', 2, 0, 2, 'Προαιρετικο');

and an error message is displayed:
[b]#1406 - Data too long for column 'name_lesson' at row 1 [/b]

in mysql 4.x this query was executed but now in mysql 5 there is this error.
can you help me?
[/quote]

Share this post


Link to post
Share on other sites
if the above doesnt work have it echo the SQL statement so you can see what values are being put where.... you may have a variable defined as something other then oyu think it is

Share this post


Link to post
Share on other sites
i tried this but the problem eventually is with the language.
for example:
if i write this:

INSERT INTO `lessons_per_exam` ( `lesson_id` , `examino` , `name_lesson` , `exam_char` , `theory` , `lab` , `state` , `state_char` ) VALUES (9, 1, '[b]Επιστήμη των Υπολογιστών[/b]', 'Α', 2, 0, 2, '[b]Προαιρετικο[/b]');

it is not acceptable.and the message is displayed


whereas if i write this:
INSERT INTO `lessons_per_exam` ( `lesson_id` , `examino` , `name_lesson` , `exam_char` , `theory` , `lab` , `state` , `state_char` ) VALUES (9, 1, '[b]computer science[/b]', 'Α', 2, 0, 2, '[b]optional[/b]');
everything ok.

so the columns accept only the english chars. have you any idea about how i can solve the language problem?
[b]i use phpmyadmin 2.8.2[/b]

Share this post


Link to post
Share on other sites
Could be a collation problem - http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.