H
|
hydkrash 2/23/2009 |
Simple but very useful code A. This tutorial is for who wants to have a multiple selection of fields/items from different categories... B. Fields/Items are sorted by related categories ------------------------------------------------------------------------------------------------- 1. Create an table for the items: CREATE TABLE `test`.`items` (
CREATE TABLE `test`.`categories` (
echo ' <input type=hidden name="" value="multiselect">
|
K
|
kinho 2/26/2009 |
Hi, I believe the edit page will be highly dependent on how the data is thereafter stored into the database. Either store it as a deliminated string, or a normalized array. Any suggestions would be good.
|
D
|
Darkwoods author 2/26/2009 |
The code itself looks fine to me. Are you intending to add multiple items from multiple categories to the database? Judging from the tables - categories and items, I think it saved one item per record, so you will be saving multiple item records on multiple selections. By the way, did the code snipnet do any record saving? Seemingly I am missing something here, can you elaborate a little more after a user select multiple items/fields from the categoties? Regards, Kin
|
U
|
unimatrix 5/27/2009 |
In order to save to field, use this: |
U
|
unimatrix 6/19/2009 |
Here is how to make it work on the edit page (and even select options that are already selected. $dbquery = mysql_query('SELECT * FROM `com_option_cat` WHERE `vender_id` ='.$_SESSION["OwnerID"]) or die("no results in cat");//print_r($_SESSION); |