Displaying 1 result from an estimated 1 matches for "blue_widget".
Did you mean:
bluewidget
2010 Jan 20
4
Searching an array
...;d like to clean it up a
bit. I''ve placed the following items in an array (please excuse my lack
of proper syntax):
@widgets =
[1, red]
[2, blue]
[3, red]
[4, blue]
I''d like to learn a way to search through the @widgets variable an
separate the widgets, so that I could have:
@blue_widgets =
[2, blue]
[4, blue]
@red_widgets =
[1, red]
[4, blue]
...after performing a query on @widgets.
I''m accomplishing this now by doing multiple queries to my database, but
I''m sure there''s a way to do it by just doing one query, and then
separating the data into diffe...