use explode() or split(), these will split up your string eand return
the resulting elements as an array.
Generally speaking its not reaally good practice to store multiple
entries as a comma sepparated string in one db field, since it takes
down the data integrity of your database. Better would be to just store
them in three sepperate columns in your table. If the number of items is
not always the same, you should store these as individual entries in a
sepperate table with the primary key of your original table.
This way you can use the full potential of your database.
My humble opinion though,
Jamie Saunders wrote:
> In a MySQL database I have one field that holds several entries seperated by
> a comma (e.g. item1,item2,item3). What I want to do is to get these items
> from the db from a PHP script and display each item on it's own line (e.g.
> item1<br>item2<br>item3). Is there anyway of doing this easily by simply
> changing each comma to a '<br>' in the script?
> Jamie Saunders
> [EMAIL PROTECTED]
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
tel: +31 20 428 6868
fax: +31 20 470 6905
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]