For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > May 2004 > explode() and a database call...?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author explode() and a database call...?
Tristan Pretty

2004-05-18, 12:30 pm

I'm trying to split up a field from a database that contains a list of
No's (Eg:1, 4, 12, 32)
If I do:
$bands_array = explode(",", "1, 4, 12, 32");

I get the following array:
$bands_array[0] = 1
$bands_array[1] = 4
$bands_array[2] = 12
$bands_array[3] = 32

All good!
However...
Calling froma database...
$bands_array = explode(',', $row[bands]);

I get no values in the array, (I have checked the overall value of
$row[bands] and it does contain "1, 4, 12, 32")

os my question is: why is the database call, changing how explode works?

Tris...?


****************************************
*****************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
****************************************
*******************************
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com