# Rails \<-\> MySQL

**URL:** <https://www.ruby-forum.com/t/rails-mysql/133207>\
**Category:** Rails\
**Created:** [March 28, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/rails-mysql/133207 "2008-03-28T19:11:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 28, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/rails-mysql/133207/1 "2008-03-28T19:11:46Z")

</div>

Hi there,

I have this table “friendships” and it contains the 2 columns:

- fsrq\_sender\_id
- fsrq\_receiver\_id

When I tell Rails to create a record, the log file says (correctly, it  
seems to me):  
INSERT INTO `friendships` (`fsrq_sender_id`, `fsrq_receiver_id`)  
VALUES(139, 140)

But when I check the new database record, both of the fields hold the  
value ‘127’ (instead of ‘139’ and ‘140’).

How can this be???

Thanks a lot for any help with this strange thing!  
Tom

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 28, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/rails-mysql/133207/2 "2008-03-28T20:36:28Z")

</div>

> But when I check the new database record, both of the fields hold the  
> value ‘127’ (instead of ‘139’ and ‘140’).
> 
> How can this be???

Odds are the fields in that table are using TINYINT which has a maximum  
value of 127. What’s the schema for that table?

-philip

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 28, 2008, 8:47pm UTC](https://www.ruby-forum.com/t/rails-mysql/133207/3 "2008-03-28T20:47:35Z")

</div>

Thanks, Philip! That was exactly it!

Good to have guys like you…  
Tom
