You are here: Re: Population array from string of comma separated numbers? « PHP Programming Language « IT news, forums, messages
Re: Population array from string of comma separated numbers?

Posted by Miguel Cruz on 07/29/06 18:02

"Rik" <luiheidsgoeroe@hotmail.com> wrote:
> Gary Hasler wrote:
>> usenet@isotopeREEMOOVEmedia.com wrote:
>>> How would one create an array from the values in string ?
>>> $mystring = "67,11,68,11,69,11,70,11"; // comes from a varchar
>>> MySQL field
>>>
>>> I wish that
>>> $myarray = array($mystring);
>>> would work, but it doesn't seem to....
>> I think you want
>> $myarray = explode($mystring, ",");
>
> Which would offcourse work, but seriously reconsider your database if that's
> how you store your data. It shouldn't be necessary to split data in a field.

Not everything needs to be normalized. If those numbers are never
searched on individually or linked to anything else in the database,
there's no point taking on all the overhead (in programming and storage
space) to create a separate table and join them.

miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация