# Split variable from database

**URL:** <https://forum.kirupa.com/t/split-variable-from-database/53404>\
**Category:** flash\
**Created:** [June 3, 2004, 11:51am UTC](https://forum.kirupa.com/t/split-variable-from-database/53404 "2004-06-03T11:51:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zebdaag](https://avatars.discourse-cdn.com/v4/letter/z/53a042/32.png) [@zebdaag](https://forum.kirupa.com/u/zebdaag)\
**Post date:** [June 3, 2004, 11:51am UTC](https://forum.kirupa.com/t/split-variable-from-database/53404/1 "2004-06-03T11:51:09Z")

</div>

Hi this is what the problem is:

I have variable “newsText”  
“newsText” = a row of numbers like this:  
2  
3  
4  
5  
Now I want to split this row of numbers(so that they will look like this 2,3,4,5) i tried it this way:

```auto
 [font=Courier New][color=#ff8000]str_arr = newsText.split("
"); [/color][/font]

```

This works well when i’m using it offline but the fact is that the variable “a” is comming from a database. Therefor this script aint working.  
Here is de webpage where I’m trying it…  
[http://www.nearestneighbour.net](http://www.nearestneighbour.net)  
The first row of numbers is “newsText”  
The second row is “str\_arr” already gone through the script i added above.  
I added the files I’m working on hope someone can help me.
