Re: How to convert array to string, and vice versa
- From: Oli Filth <catch@xxxxxxxxxxxxxx>
- Date: Tue, 23 May 2006 17:20:29 GMT
Tim Streater said the following on 23/05/2006 17:49:
I have some items, numbered from 0 upwards. Some of them may have a string attached. All these items need to be represented in a single already existing database record. So, I thought of taking an array, as it might be looking thus (the values are all strings):
Key Value
--- -----
0 firstone
2 somestring
5 anotherstr
and so on, and converting it to a single string:
"'0', 'firstone', '2', 'somestring', '5', 'anotherstr'"
then I have a string I can write to the database record.
Is it absolutely mandatory that you put these into a single record? This is almost certainly a bad idea. Not only do you have to write conversion functions to get data into and out of the database, but you data is no longer atomic. Amongst other things, this makes it difficult to search, index, delete or reference your data...
--
Oli
.
- Follow-Ups:
- Re: How to convert array to string, and vice versa
- From: Tim Streater
- Re: How to convert array to string, and vice versa
- From: Tim Streater
- Re: How to convert array to string, and vice versa
- References:
- How to convert array to string, and vice versa
- From: Tim Streater
- How to convert array to string, and vice versa
- Prev by Date: Re: How to convert array to string, and vice versa
- Next by Date: Re: ldap_bind problem
- Previous by thread: Re: How to convert array to string, and vice versa
- Next by thread: Re: How to convert array to string, and vice versa
- Index(es):
Relevant Pages
|