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

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

why aint this working?
i have this code:

Code: $num = 250;
$count = ($num - $rcount);

echo $rc

HOW to get the bind variables list.
I've the following problem : I've some SQL queries stored in my DB as VARCHAR2 values.
I need t

DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This i

Using unserialize()
Hi there.

I have some data in my database that is serialized.

e.g.

a:2:{i:0

help with mysql_error()
Hi,

I am trying to insert data into a table, but I am not able to insert it. I wanted to see

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

Email Script does not reach destination
Hey Guys look at this code snippet :
Code:
//read a line from the file

$myFile = "

ereg_replace in Wordpress
Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patients

The

Why do I get this error
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a5488351/public_html/b

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