You are here: Re: Multiple Categories « All PHP « IT news, forums, messages
Re: Multiple Categories

Posted by Tex John on 03/18/05 20:33

<select name="test[]" multiple="multiple">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
<option value="four">four</option>
<option value="five">five</option>
</select>


$query = "INSERT INTO database SET ";
for ($x = 0; $x < count($test); $x++) {
$query .= "column = '".$test[$x]."'";
if($x < (count($test) + 1)) $query .= ", ";
}
$query .= "WHERE foo = 'bar'";

You mean like that?

John



"Jeremy Ross" <reply@newsgroup-please.com> wrote in message
news:iNf_d.59765$i6.30427@edtnps90...
> Hello,
>
> I know that using the CRLT key will select multable things on a list, and
> return them in an array. The major question I have is how can I store
that
> array in a database, that would be an useful format for me to use a select
> query in MySQL
>
> Thanks,
> Jeremy Ross
>
>
> "Tex John" <john@logontexas.com> wrote in message
> news:p90_d.5951$Ux.3336@tornado.texas.rr.com...
> > You mean like this?
> >
> > http://www.onlinetools.org/tricks/using_multiple_select.php
> >
> > (use the CTRL key obviously...)
> >
> > John
> > in Houston
> >
> > "Jeremy Ross" <reply@newsgroup-please.com> wrote in message
> > news:qwXZd.60323$fc4.16306@edtnps89...
> >> Hello,
> >>
> >> I am looking for a tutorial, or some help with a slight problem that I
am
> >> having.
> >>
> >> What I need to do is create a bit of code that will allow me to select
> >> multiple categories for a product. I all ready have it so I can pick
> >> form
> > a
> >> list of categories and unlimited sub categories. Now I need it so I
can
> >> select mutable categories from a list, and the product gets displayed
on
> >> them all.
> >>
> >> I am using MySQL and PHP for this.
> >>
> >> Thanks for any help
> >> Jeremy Ross
> >>
> >>
> >
> >
>
>

 

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

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