Multiple Dropdown Selections


Posted on 16th Feb 2014 07:03 pm by admin

I have a form that let's a user insert a page with the ability to select categories. I want them to have the ability to select multiple categories. I have a select drop down menu with the "multiple" attribute applied(<select name='category' multiple>).

My question is, how would I get the categories they selected and display them like below:
Quote1, 2, 3, 4, 5
Did you know?Explore Trending and Topic pages for more stories like this.
The numbers are the ids of the categories, which is the value of the selections, and will be located in one column of the table that the current record is being created in.

Another question...

These categories are fetched from a database table(categories). The table that these records are being inserted to(pages) with this form has a column called pageID and a column called CategoryID. What I want to do is to have a page for a specific category that will fetch a list of all the pages that are under this category.

Example: a page has categories of 1, 3, and 5. The user is viewing category 5. The category page should contain a list of content pages from category five.

How would I create a query that would do this?
No comments posted yet

Your Answer:

Login to answer
322 Like 49 Dislike
Previous forums Next forums
Other forums

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will

links using header()
Hi All

I'm not sure where to ask for help on this but I hope someone can offer some. I'm at

check how many commas the variable containing the query has between [i]select[/i
Hi...

iv made an sql table that contains id number - name of sql query and an sql query.
T

foreach loop, assistance request
I would like some guidance on the usage of foreach as I try to parse through a large database and wh

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

$action = "insert"; //$action = $_GET['action'];
$action = "insert";
//$action = $_GET['action'];

why is this invalid type? I am

Alterar a hora do servidor
Se alguém souber, ajude-me a adicionar 6 horas, obrigado
<tr>
&

PHP XML extraction text
I would like to extract an xml text and have that text directly echo(print) out on my web page. Her

phpmailer class & pop.gmail.com?
Code: <?php
$mail->IsSMTP();
$mail->Host = "pop.gmail.com";

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash