# How can i store the value in db(MySql)?

**URL:** <https://www.ruby-forum.com/t/how-can-i-store-the-value-in-db-mysql/89739>\
**Category:** Ruby\
**Created:** [March 22, 2007, 1:04pm UTC](https://www.ruby-forum.com/t/how-can-i-store-the-value-in-db-mysql/89739 "2007-03-22T13:04:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@deepak](https://www.ruby-forum.com/u/deepak)\
**Post date:** [March 22, 2007, 1:04pm UTC](https://www.ruby-forum.com/t/how-can-i-store-the-value-in-db-mysql/89739/1 "2007-03-22T13:04:59Z")

</div>

Hello,

I am new in Ruby.

Can you tell me how can I store the value in databse(MySql).

I have 2 Textbox one is User Name and another one is Password and 2  
button i.e., Submit and Cancel. I want whenever I click on the submit  
button the value should be stored in the database.

I have made a table i.e., user in the database(MySql) having fields id,  
username and password. id is a primary key.

Thanks in Advance  
Deepak

---

<div class="post-metadata">

**Author:** ![deepak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@deepak](https://www.ruby-forum.com/u/deepak)\
**Post date:** [March 22, 2007, 1:27pm UTC](https://www.ruby-forum.com/t/how-can-i-store-the-value-in-db-mysql/89739/2 "2007-03-22T13:27:46Z")

</div>

Deepak Kumar Shivhare wrote:

> I have made a table i.e., user in the database(MySql) having fields id,  
> username and password. id is a primary key.

How do you access the database?  
Are you using ActiveRecord or the MySQL/Ruby gem?

And if you are using the Rails framework, you might want to ask this  
question (in a smarter[0] way) on the Rails-ML.

[0] [How To Ask Questions The Smart Way](http://www.catb.org/~esr/faqs/smart-questions.html)

–  
Phillip “CynicalRyan” Gawlowski

Rule of Open-Source Programming #20:

Open Code != Good Code
