Numeric data aren't saved to table with column-type integer

have following a structure of MySQL table:

±-----------±---------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±-----------±---------±-----±----±--------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| reg | int(11) | NO | | NULL | |
| descr | text | YES | | NULL | |
| created_at | datetime | YES | | NULL | |
| updated_at | datetime | YES | | NULL | |
±-----------±---------±-----±----±--------±---------------+
And with this way I am saving data to my database:

@saving = Table.new(:reg => 1234, :descr => params[:descr]).save
And my problem is - I don’t know how it is possible, but this query does
not save the number to column “reg”.

I am getting this error:

Mysql2::Error: Column ‘reg’ cannot be null: INSERT
INTOname_of_table(updated_at,descr,reg,created_at) VALUES (‘2011-06-06
20:40:43’, ‘description of man’, NULL, ‘2011-06-06 20:40:43’)

I worked a lot with PHP and MySQL database, but this error I never
got…

I found that the problem is with all column (also in other tables) types
except integer id (AUTO_INCREMENT) --> it’s really weird, I have no idea
what could be wrong

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs