drop down multiple selection

daisy 02 Oct, 2009
i am using chronoform so, i would to ask how to create php code in this query so that it will display more than one category?i have tried but it only display one category even i chose two category.
below is an example code of submit form from user.
<select name="Category" multiple="multiple" >
    <option value ="-Select-">-Select-</option>
    <option value="Arts & Entertaiment">Arts & Entertaiment</option>
    <option value="Business & Professional Services">Business & Professional  Services</option>
    <option value="Clothing & Accessories">Clothing & Accessories</option>

and this one is the query which will display submitted form from user.I guess something's wrong with this query but not sure how to correct it.
  $query = "select * from jos_chronoforms_submit_listing_page where txtCat LIKE '%Arts & Entertaiment%' ";
  $result = mysql_query($query);

  $txt1 = $query_data["txtCat"];

echo "$txt1";
GreyHead 02 Oct, 2009
Hi daisy,

First, we always recommend that you use the Joomla Database code to access your data. It is more secure and more portable.
$db =& JFactory::getBDO();
$query = "
    FROM `#__chronoforms_submit_listing_page`
    WHERE `txtCat` LIKE '%Arts & Entertainment%' ;
$result = $db->loadAssocList();

foreach ( $result as $k => $v ) {
  echo $v['txtCat'];

daisy 02 Oct, 2009
ok..thanks a works!
This topic is locked and no more replies can be posted.