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
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

mysql query with single quotes in a variable
$sitedetails = "INSERT INTO vars (address, sitename, description, ownername, theme) VALUES ('$u

Frustrated php Newbie
First off, I am pretty much a PHP nub. I can read and understand the language (most of the time) so

Probably Easy, Need help with Check Boxes in PHP Code
hello,

Thanks for looking this over and helping me out. My problem is I have a online store l

Cannot Display Array from Select Statement + Login question
Hi,
I'm new to PHP but so far so goog. I was assigend a project and I'm very close to completion.

Comparing MySql data and arrays.
I have a mysql table set up like this:
idsubjectbodyuseriddatetimetags1blog subjectblog body111|2

PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?

Get relative path from absolute path
How would one go about getting the relative path to a file from its absolute path?

path to include folder
Hi everyone,

When I'm testing locally, I have to add the name of the site folder as part of t

How to get variable value on next page
Hello friends
i am working on payentry page ..there i have this code.........

Getting PHP to ammended the selected in option field
Hey Guys

thanks for everyones help so far. This site and its users are oozing awesomness.

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