Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
How do I convert string/text from column to hash ???
Fransiscus Xaverius
12/13/2007 4:41:00 PM
Hello All...
I am newb in RoR, i have problem to convert data from database to hash.
Example:
* before I save data to MySQL DB to column 'budget_list', the hash is :
@market_budget = [[BMW5, 2007-12-26, 30000], [BMW3, 2007-12-31,
150000], [HONDA1, 2007-12-19, 10000], [HONDA2, 2007-12-31, 10000],
[JAGUAR5, 2007-12-28, 50000], [JAGUAR11, 2007-12-18, 70000]]
* Data after stored in column 'budget_list' with text type data in MySQL
DB:
---
- - 101
- BMW5
- 2007-12-26
- 30000
- - 102
- BMW3
- 2007-12-31
- 150000
- - 22
- HONDA1
- 2007-12-19
- 10000
- - 23
- HONDA2
- 2007-12-31
- 10000
- - 26
- JAGUAR5
- 2007-12-28
- 50000
- - 27
- JAGUAR11
- 2007-12-18
- 70000
Now i want call data from column 'budget_list' to be like hash again,
before hash stored to db. How I can make data budget_list to be :
@market_budget = [[BMW5, 2007-12-26, 30000], [BMW3, 2007-12-31,
150000], [HONDA1, 2007-12-19, 10000], [HONDA2, 2007-12-31, 10000],
[JAGUAR5, 2007-12-28, 50000], [JAGUAR11, 2007-12-18, 70000]]
Please help me, thank you very much.
FX
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
How do I convert string/text from column to hash ???
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password