Let's say I have made a table in my database, which table contains a text type field. Within this field there are ten lines which correspond to ten different values. What I want to do for example, is to call this field (I have already done this) but I want to get only the fifth line! Or each line separately anyway... Does anyone have any idea how to do this?
-
Do you have any more certain way to address that line other than "fifth line"? An identifier? A some certain value? – Your Common Sense Jul 19 '13 at 08:35
2 Answers
As previously stated, this does not smell good. It sounds a lot like your data is not normalised and you'd make life a lot easier if you did separate the delimited values...
...HOWEVER I know all too well that sometimes it's just not possible. I frequently have to deal with this kind of thing (thanks to decisions made using legacy technologies being perpetuated beyond my control).
If you too are stuck with someone else's design decision, this should do the trick:
http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/
EDIT: Downvote without a comment? Nice...

- 423
- 4
- 9
-
Wasn't mine... I never downvote people who spent their time to answer to me, even if their answer isn't what I want! – Simos Sigma Jul 19 '13 at 10:30
That's easy.
You need to create another table linked to this one.
And have ten different records in this new table corresponding to one record in your old table.
This is how databases work.

- 156,878
- 40
- 214
- 345
-
1There is a table in my database that contains a text type field and in to this field you can find values like this [link](http://img853.imageshack.us/img853/2861/oa2.png). – Simos Sigma Jul 19 '13 at 08:54
-
-
1I think you don't understand what I want to do... Every value has something after "=". I want to take this part of text, after "=" or the whole line! To help you understand, they are joomla's parameters. – Simos Sigma Jul 19 '13 at 09:08
-
1