-1

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?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Simos Sigma
  • 958
  • 7
  • 29

2 Answers2

0

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...

Tom Tom
  • 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
-1

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.

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
  • 1
    There 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
  • Yes. That's what a new table I am talking about for. – Your Common Sense Jul 19 '13 at 09:02
  • 1
    I 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
    Your Common Sense you are out of the subject – DNA180 Jul 20 '13 at 06:37