mnewm
asked on
PHP Implode - Multiple List database entry
Problem:
Multiple list inserted into database field as one entry.
Question:
I can insert the last choice selected from the multiple list, and have had no success with PHP implode. What am I missing?
Code:
<?php require_once('Connections/ conn_Sushi SUshi.php' ); ?>
<?php require_once("WA_DataAssis t/WA_AppBu ilder_PHP. php"); ?>
<?php require_once("WA_DigitalFi lePro/Help erPHP.php" ); ?>
<?php $array_stores = array('store');
$comma_sep = implode(",", $array_stores);
mysql_select_db($database_ conn_Sushi SUshi, $conn_SushiSUshi);
$query_rs_StorefinderInclu de = "SELECT ID, name FROM storefinder ORDER BY name ASC";
$rs_StorefinderInclude = mysql_query($query_rs_Stor efinderInc lude, $conn_SushiSUshi) or die(mysql_error());
$row_rs_StorefinderInclude = mysql_fetch_assoc($rs_Stor efinderInc lude);
$totalRows_rs_StorefinderI nclude = mysql_num_rows($rs_Storefi nderInclud e);
mysql_select_db($database_ conn_Sushi SUshi, $conn_SushiSUshi);
$query_rs_storefinderSelec t = "SELECT * FROM storefinder ORDER BY name ASC";
$rs_storefinderSelect = mysql_query($query_rs_stor efinderSel ect, $conn_SushiSUshi) or die(mysql_error());
$row_rs_storefinderSelect = mysql_fetch_assoc($rs_stor efinderSel ect);
$totalRows_rs_storefinderS elect = mysql_num_rows($rs_storefi nderSelect );?>
<?php
WA_DFP_SetupUploadStatusSt ruct("WA_U ploadResul t1");
if($_SERVER["REQUEST_METHO D"] == "POST"){
      WA_DFP_UploadFile("WA_Uplo adResult1" , "cv", "", "../admin/sushisushi/staff /cv/", "".((isset($_POST["fName"] ))?$_POST[ "fName"]:" ")  ."".((isset($_POST["lName" ]))?$_POST ["lName"]: "")  ."", "2", "[FileName]_[Increment]", "0", "false", "0", "0");
}
?><?php
// WA Application Builder Insert
if (isset($_POST["Submit"])) // Trigger
{
 $WA_connection = $conn_SushiSUshi;
 $WA_table = "messageCentre";
 $WA_sessionName = "messageCentre_ID";
 $WA_redirectURL = "sushi-contact-thanks.php" ;
 $WA_keepQueryString = false;
 $WA_indexField = "ID";
 $WA_fieldNamesStr = "dateSubmitted|store|comme nt|contact Method|fNa me|lName|e mail|sushi Newsletter |cv|add1|a dd2|suburb |state|tow nCity|coun ty|telDay| telEve|pos tcode";
 $WA_fieldValuesStr = "".((isset($_POST["dateSub mit"]))?$_ POST["date Submit"]:" ")  ."" . "|" . "".((isset($_POST[$comma_s ep]))?$_PO ST[$comma_ sep]:"")  ."" . "|" . "".((isset($_POST["message "]))?$_POS T["message "]:"")  ."" . "|" . "".((isset($_POST["preferr edContact" ]))?$_POST ["preferre dContact"] :"")  ."" . "|" . "".((isset($_POST["fName"] ))?$_POST[ "fName"]:" ")  ."" . "|" . "".((isset($_POST["lName"] ))?$_POST[ "lName"]:" ")  ."" . "|" . "".((isset($_POST["email"] ))?$_POST[ "email"]:" ")  ."" . "|" . "".((isset($_POST["receive News"]))?$ _POST["rec eiveNews"] :"")  ."" . "|" . "http://www.sushisushi.com.au/admin/sushisushi/staff/cv/".$WA_DFP_UploadStatus["W A_UploadRe sult1"]["s erverFileN ame"]  ."" . "|" . "".((isset($_POST["add1"]) )?$_POST[" add1"]:"")  ."" . "|" . "".((isset($_POST["add2"]) )?$_POST[" add2"]:"")  ."" . "|" . "".((isset($_POST["suburb" ]))?$_POST ["suburb"] :"")  ."" . "|" . "".((isset($_POST["state"] ))?$_POST[ "state"]:" ")  ."" . "|" . "".((isset($_POST["townCit y"]))?$_PO ST["townCi ty"]:"")  ."" . "|" . "".((isset($_POST["county" ]))?$_POST ["county"] :"")  ."" . "|" . "".((isset($_POST["telDay" ]))?$_POST ["telDay"] :"")  ."" . "|" . "".((isset($_POST["telEve" ]))?$_POST ["telEve"] :"")  ."" . "|" . "".((isset($_POST["postcod e"]))?$_PO ST["postco de"]:"")  ."";
 $WA_columnTypesStr = "',none,''|',none,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''|',non e,''";
 $WA_fieldNames = explode("|", $WA_fieldNamesStr);
 $WA_fieldValues = explode("|", $WA_fieldValuesStr);
 $WA_columns = explode("|", $WA_columnTypesStr);
 $WA_connectionDB = $database_conn_SushiSUshi;
 mysql_select_db($WA_connec tionDB, $WA_connection);
 if (!session_id()) session_start();
 $insertParamsObj = WA_AB_generateInsertParams ($WA_field Names, $WA_columns, $WA_fieldValues, -1);
 $WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_table Values . ") VALUES (" . $insertParamsObj->WA_dbVal ues . ")";
 $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
 $_SESSION[$WA_sessionName] = mysql_insert_id();
 if ($WA_redirectURL != "")  {
  if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRI NG"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
   $WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER[" QUERY_STRI NG"];
  }
  header("Location: ".$WA_redirectURL);
 }
}
?>
<?php $relroot = ""Â ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Contact SUSHI SUSHI™</title>
<meta name="description" content="Ask us a question - tell us a bout your visit - talk to the SUSHI SUSHIT Chef">
<meta name="keywords" content="Sushi Sushi Chef Platter Victoria Australia Quality Nigiri boxes packs inari plate heroes Broadmeadows Camberwell Centro Box Hill Hawthorn Chadstone Broadmeadows Forest Frankston Highpoint Knox Melbourne Central Northland Prahan The Glen Pines Victoria Gardens Waverly Whitehorse ">
<meta name="robots" content="index,follow">
<script language="javascript" type="text/javascript" src="Scripts/formvalidate_ general.js "></script >
<link href="2col_rightNav.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #0081AB}
#shareCare {position:absolute;
      width:621px;
      height:auto;
      z-index:101;
      left: 154px;
      top: 560px;
      background-color: #FFF;
      background-image:url(image s/layerBg. jpg);
      background-position:bottom center;
      background-repeat:no-repea t;
      visibility: hidden;
      border: 1px solid #999999;
}
-->
</style>
<style type="text/css">
<!--
.style4 {
      color: #FFCC66;
      font-weight: bold;
}
-->
</style><?php include("includes/top.inc. php");?>
<div id="main">
<div id="content">
 <div>
  <h3> Work at <strong><img src="image/logo.gif" width="200" height="32" alt="Sushi Sushi Chef"></strong></h3>
  <p align="left"><strong><img src="image/chef1.jpg" alt="sushi sushi Chef" width="114" height="133" class="floatleft">Interest ed in working for  <a href="contact-sushi-sushi- form.php"> <strong><i mg src="image/logoBody.gif" alt="sushi sushi" width="114" height="12" border="0"></strong></a>?< /strong><s trong> Fill out the form below and someone will get back to you! </strong></p>
  <p>Thank You very much!</p>
  <p><strong><a href="sushi-storefinder.ph p"><img src="image/logoBody.gif" alt="sushi sushi" width="114" height="12" border="0"></a></strong> Chef
      <hr>
           <form action="<? $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-da ta" name="general" id="rateweb" onSubmit="return checkform();">
  <TABLE width="625" cellPadding="1" cellSpacing="1" id="Table1">
   <TR>
    <TD valign="top" style="WIDTH: 239px"><TABLE width="100%" cellPadding="1" cellSpacing="0" class="copydark" id="Table2">
     Â
      <TR>
       <TD valign="top" noWrap><P align="right"><font color="#ff0000">
        <input name="dateSubmit" type="hidden" value="<? echo date("D, j/m/y");?>">
       </font>First Name<FONT color="#ff0000">*</FONT></ P></TD>
       <TD valign="middle"><input name="fName" type="text" maxlength="50" id="fName" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Surname<FONT color="#ff0000">*</FONT></ P></TD>
       <TD vAlign="middle"><input name="lName" type="text" maxlength="50" id="lName" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right" >Email Address<FONT color="#ff0000">*</FONT></ P></TD>
       <TD vAlign="middle"><input name="email" type="text" maxlength="150" id="email" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Address</P>< /TD>
       <TD vAlign="middle"><input name="add1" type="text" maxlength="50" id="add1" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><p align="right"> </p></ TD>
       <TD vAlign="middle"><input name="add2" type="text" maxlength="50" id="add2" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><p align="right">Suburb</p></ TD>
       <TD vAlign="middle"><input name="suburb" type="text" maxlength="50" id="suburb" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><p align="right">State</p></T D>
       <TD vAlign="middle"><input name="state" type="text" maxlength="50" id="state" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Town / City</P></TD>
       <TD vAlign="middle"><input name="townCity" type="text" maxlength="50" id="townCity" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">County</P></ TD>
       <TD vAlign="middle"><input name="county" type="text" maxlength="50" id="county" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Post Code</P></TD>
       <TD vAlign="middle"><input name="postcode" type="text" maxlength="10" id="postcode" class="CopyDark" /></TD>
      </TR>
    </TABLE>
     <p>Please provide us with your CV here:     Â
     <label><br>
     </label>
     <input name="cv" type="file" size="28">
     </p></TD>
    <TD vAlign="top"><TABLE width="100%" cellPadding="3" cellSpacing="1" class="copydark" id="Table3">
      <TR>
       <TD valign="middle" noWrap><P align="right">Telephone DAY<FONT color="#ff0000">*</FONT>&n bsp; </P></TD>
       <TD vAlign="middle"><input name="telDay" type="text" maxlength="20" id="txtPhone" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="middle" noWrap><P align="right">Telephone EVE<FONT color="#ff0000">*</FONT>&n bsp; </P></TD>
       <TD vAlign="middle"><input name="telEve" type="text" maxlength="20" id="txtPhone" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD colSpan="2" noWrap><P align="center"> </P>
        </TD>
       </TR>
      <TR>
       <TD noWrap align="right" colSpan="2">Brief outline of your enquiry<font color="#ff0000">*</font>
        <textarea name="message" cols="25" rows="4" class="CopyDark" id="message"></textarea></ TD></TR>
      <TR>
       <TD noWrap colSpan="2"><P align="right"><strong>How would you like us to contact you?</strong></P>
         <P align="right"><span class="style4">Telephone day
           <input name="preferredContact" type="radio" value="Tel Day">
           <br>
          Telephone evening
          <input name="preferredContact" type="radio" value="Tel Eve">
          <br>
          Email</span>
          <input name="preferredContact" type="radio" value="email" checked>
        </P></TD>
      </TR>
    </TABLE></TD>
   </TR>
   <TR class="copydark">
    <TD colSpan="2"><div align="right"> <br>
     <table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
       <tr>
        <td><div align="center">Please select which restaurant(s) you would<br>
         be interested in working at: </div></td>
       </tr>
       <tr>
        <td align="center" valign="middle"><label>
        <select name="store" size="10" multiple id="store" style="width:250px">
         <option value="">Please Select</option>
         <?php
do { Â
?>
         <option value="<?php echo $row_rs_storefinderSelect[ 'name']?>" ><?php echo $row_rs_storefinderSelect[ 'name']?>< /option>
         <?php
} while ($row_rs_storefinderSelect = mysql_fetch_assoc($rs_stor efinderSel ect));
 $rows = mysql_num_rows($rs_storefi nderSelect );
 if($rows > 0) {
   mysql_data_seek($rs_storef inderSelec t, 0);
       $row_rs_storefinderSelect = mysql_fetch_assoc($rs_stor efinderSel ect);
 }
?>
        </select>
        </label></td>
       </tr>
      </table>
      <hr> <p align="center">Would you like to receive occasional email updates from <strong><a href="sushi-storefinder.ph p"><img src="image/logoBody.gif" alt="sushi sushi" width="114" height="12" border="0"></a></strong> detailing new dishes, special offers and what else is happening at <strong><a href="sushi-storefinder.ph p"><img src="image/logoBody.gif" alt="sushi sushi" width="114" height="12" border="0"></a></strong>? </p>
    </div></TD>
   </TR>
   <TR class="copydark">
    <TD colSpan="2"><p align="center" class="style4">Yes please
       <input name="receiveNews" type="radio" value="yes">
        <br>
     No thank you
     <input name="receiveNews" type="radio" value="no">
    </p>
     <p align="center" class="style4"> </p>< /TD>
   </TR>
   <TR class="copydark">
    <TD colSpan="2"><div align="center">
     <input name="Submit" type="submit" class="buttonAsLink_hover" value="Submit">
    </div></TD>
   </TR>
  </TABLE>
      </form>
  <p align="left"> </p>
  <div align="left"></div>
 </div>
 </div>
<div id="navBar">
<div align="center"><strong><br >
   Select your<br>
   <img src="<?php echo $relroot?>image/logoBody.g if" width="114" height="12" alt="sushi sushi"></strong> <strong>Store</strong>:   </div>
        <div align="left" style="font-size:80%"><p>< ?php do { ?>
        <a href="sushi-storefinder-re sults.php? S_ID=<? echo $row_rs_StorefinderInclude ['ID']; ?>"><?php echo $row_rs_StorefinderInclude ['name']; ?></a><br>
         <?php } while ($row_rs_StorefinderInclud e = mysql_fetch_assoc($rs_Stor efinderInc lude)); ?></div>
     <? echo $comma_sep ;?>
</div>
<br clear="all">
</div>
</div><br clear="all">
<?php include("includes/footer.i nc.php");? >
 <?php
mysql_free_result($rs_Stor efinderInc lude);
mysql_free_result($rs_stor efinderSel ect);
?>
Downloaded a Dreamweaver extension which puts multiple lists into an array, but no way of referencing it. The extension puts the following code in the header:
if (isset($_POST["store"]) &&Â is_array($_POST["store"])) {
 $_POST["store"] = implode(",", $_POST["store"]);
 $HTTP_POST_VARS["store"] = $_POST["store"];
}
Could I reference this code to enter into the database? The 'store' field wants to go into a database 'cell' for the row as a list (preferably comma separated) and will need exploding again.
Any help appreciated.
Thanks,
MNEWM
Multiple list inserted into database field as one entry.
Question:
I can insert the last choice selected from the multiple list, and have had no success with PHP implode. What am I missing?
Code:
<?php require_once('Connections/
<?php require_once("WA_DataAssis
<?php require_once("WA_DigitalFi
<?php $array_stores = array('store');
$comma_sep = implode(",", $array_stores);
mysql_select_db($database_
$query_rs_StorefinderInclu
$rs_StorefinderInclude = mysql_query($query_rs_Stor
$row_rs_StorefinderInclude
$totalRows_rs_StorefinderI
mysql_select_db($database_
$query_rs_storefinderSelec
$rs_storefinderSelect = mysql_query($query_rs_stor
$row_rs_storefinderSelect = mysql_fetch_assoc($rs_stor
$totalRows_rs_storefinderS
<?php
WA_DFP_SetupUploadStatusSt
if($_SERVER["REQUEST_METHO
      WA_DFP_UploadFile("WA_Uplo
}
?><?php
// WA Application Builder Insert
if (isset($_POST["Submit"])) // Trigger
{
 $WA_connection = $conn_SushiSUshi;
 $WA_table = "messageCentre";
 $WA_sessionName = "messageCentre_ID";
 $WA_redirectURL = "sushi-contact-thanks.php"
 $WA_keepQueryString = false;
 $WA_indexField = "ID";
 $WA_fieldNamesStr = "dateSubmitted|store|comme
 $WA_fieldValuesStr = "".((isset($_POST["dateSub
 $WA_columnTypesStr = "',none,''|',none,''|',non
 $WA_fieldNames = explode("|", $WA_fieldNamesStr);
 $WA_fieldValues = explode("|", $WA_fieldValuesStr);
 $WA_columns = explode("|", $WA_columnTypesStr);
 $WA_connectionDB = $database_conn_SushiSUshi;
 mysql_select_db($WA_connec
 if (!session_id()) session_start();
 $insertParamsObj = WA_AB_generateInsertParams
 $WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_table
 $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
 $_SESSION[$WA_sessionName]
 if ($WA_redirectURL != "")  {
  if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRI
   $WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["
  }
  header("Location: ".$WA_redirectURL);
 }
}
?>
<?php $relroot = ""Â ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Contact SUSHI SUSHI™</title>
<meta name="description" content="Ask us a question - tell us a bout your visit - talk to the SUSHI SUSHIT Chef">
<meta name="keywords" content="Sushi Sushi Chef Platter Victoria Australia Quality Nigiri boxes packs inari plate heroes Broadmeadows Camberwell Centro Box Hill Hawthorn Chadstone Broadmeadows Forest Frankston Highpoint Knox Melbourne Central Northland Prahan The Glen Pines Victoria Gardens Waverly Whitehorse ">
<meta name="robots" content="index,follow">
<script language="javascript" type="text/javascript" src="Scripts/formvalidate_
<link href="2col_rightNav.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #0081AB}
#shareCare {position:absolute;
      width:621px;
      height:auto;
      z-index:101;
      left: 154px;
      top: 560px;
      background-color: #FFF;
      background-image:url(image
      background-position:bottom
      background-repeat:no-repea
      visibility: hidden;
      border: 1px solid #999999;
}
-->
</style>
<style type="text/css">
<!--
.style4 {
      color: #FFCC66;
      font-weight: bold;
}
-->
</style><?php include("includes/top.inc.
<div id="main">
<div id="content">
 <div>
  <h3> Work at <strong><img src="image/logo.gif" width="200" height="32" alt="Sushi Sushi Chef"></strong></h3>
  <p align="left"><strong><img src="image/chef1.jpg" alt="sushi sushi Chef" width="114" height="133" class="floatleft">Interest
  <p>Thank You very much!</p>
  <p><strong><a href="sushi-storefinder.ph
      <hr>
           <form action="<? $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-da
  <TABLE width="625" cellPadding="1" cellSpacing="1" id="Table1">
   <TR>
    <TD valign="top" style="WIDTH: 239px"><TABLE width="100%" cellPadding="1" cellSpacing="0" class="copydark" id="Table2">
     Â
      <TR>
       <TD valign="top" noWrap><P align="right"><font color="#ff0000">
        <input name="dateSubmit" type="hidden" value="<? echo date("D, j/m/y");?>">
       </font>First Name<FONT color="#ff0000">*</FONT></
       <TD valign="middle"><input name="fName" type="text" maxlength="50" id="fName" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Surname<FONT
       <TD vAlign="middle"><input name="lName" type="text" maxlength="50" id="lName" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right" >Email Address<FONT color="#ff0000">*</FONT></
       <TD vAlign="middle"><input name="email" type="text" maxlength="150" id="email" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Address</P><
       <TD vAlign="middle"><input name="add1" type="text" maxlength="50" id="add1" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><p align="right"> </p></
       <TD vAlign="middle"><input name="add2" type="text" maxlength="50" id="add2" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><p align="right">Suburb</p></
       <TD vAlign="middle"><input name="suburb" type="text" maxlength="50" id="suburb" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><p align="right">State</p></T
       <TD vAlign="middle"><input name="state" type="text" maxlength="50" id="state" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Town / City</P></TD>
       <TD vAlign="middle"><input name="townCity" type="text" maxlength="50" id="townCity" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">County</P></
       <TD vAlign="middle"><input name="county" type="text" maxlength="50" id="county" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="top" noWrap><P align="right">Post Code</P></TD>
       <TD vAlign="middle"><input name="postcode" type="text" maxlength="10" id="postcode" class="CopyDark" /></TD>
      </TR>
    </TABLE>
     <p>Please provide us with your CV here:     Â
     <label><br>
     </label>
     <input name="cv" type="file" size="28">
     </p></TD>
    <TD vAlign="top"><TABLE width="100%" cellPadding="3" cellSpacing="1" class="copydark" id="Table3">
      <TR>
       <TD valign="middle" noWrap><P align="right">Telephone DAY<FONT color="#ff0000">*</FONT>&n
       <TD vAlign="middle"><input name="telDay" type="text" maxlength="20" id="txtPhone" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD valign="middle" noWrap><P align="right">Telephone EVE<FONT color="#ff0000">*</FONT>&n
       <TD vAlign="middle"><input name="telEve" type="text" maxlength="20" id="txtPhone" class="CopyDark" /></TD>
      </TR>
      <TR>
       <TD colSpan="2" noWrap><P align="center"> </P>
        </TD>
       </TR>
      <TR>
       <TD noWrap align="right" colSpan="2">Brief outline of your enquiry<font color="#ff0000">*</font>
        <textarea name="message" cols="25" rows="4" class="CopyDark" id="message"></textarea></
      <TR>
       <TD noWrap colSpan="2"><P align="right"><strong>How would you like us to contact you?</strong></P>
         <P align="right"><span class="style4">Telephone day
           <input name="preferredContact" type="radio" value="Tel Day">
           <br>
          Telephone evening
          <input name="preferredContact" type="radio" value="Tel Eve">
          <br>
          Email</span>
          <input name="preferredContact" type="radio" value="email" checked>
        </P></TD>
      </TR>
    </TABLE></TD>
   </TR>
   <TR class="copydark">
    <TD colSpan="2"><div align="right"> <br>
     <table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
       <tr>
        <td><div align="center">Please select which restaurant(s) you would<br>
         be interested in working at: </div></td>
       </tr>
       <tr>
        <td align="center" valign="middle"><label>
        <select name="store" size="10" multiple id="store" style="width:250px">
         <option value="">Please Select</option>
         <?php
do { Â
?>
         <option value="<?php echo $row_rs_storefinderSelect[
         <?php
} while ($row_rs_storefinderSelect
 $rows = mysql_num_rows($rs_storefi
 if($rows > 0) {
   mysql_data_seek($rs_storef
       $row_rs_storefinderSelect = mysql_fetch_assoc($rs_stor
 }
?>
        </select>
        </label></td>
       </tr>
      </table>
      <hr> <p align="center">Would you like to receive occasional email updates from <strong><a href="sushi-storefinder.ph
    </div></TD>
   </TR>
   <TR class="copydark">
    <TD colSpan="2"><p align="center" class="style4">Yes please
       <input name="receiveNews" type="radio" value="yes">
        <br>
     No thank you
     <input name="receiveNews" type="radio" value="no">
    </p>
     <p align="center" class="style4"> </p><
   </TR>
   <TR class="copydark">
    <TD colSpan="2"><div align="center">
     <input name="Submit" type="submit" class="buttonAsLink_hover"
    </div></TD>
   </TR>
  </TABLE>
      </form>
  <p align="left"> </p>
  <div align="left"></div>
 </div>
 </div>
<div id="navBar">
<div align="center"><strong><br
   Select your<br>
   <img src="<?php echo $relroot?>image/logoBody.g
        <div align="left" style="font-size:80%"><p><
        <a href="sushi-storefinder-re
         <?php } while ($row_rs_StorefinderInclud
     <? echo $comma_sep ;?>
</div>
<br clear="all">
</div>
</div><br clear="all">
<?php include("includes/footer.i
 <?php
mysql_free_result($rs_Stor
mysql_free_result($rs_stor
?>
Downloaded a Dreamweaver extension which puts multiple lists into an array, but no way of referencing it. The extension puts the following code in the header:
if (isset($_POST["store"]) &&Â is_array($_POST["store"]))
 $_POST["store"] = implode(",", $_POST["store"]);
 $HTTP_POST_VARS["store"] = $_POST["store"];
}
Could I reference this code to enter into the database? The 'store' field wants to go into a database 'cell' for the row as a list (preferably comma separated) and will need exploding again.
Any help appreciated.
Thanks,
MNEWM
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
jason1178 - you gave half the solution, but I had to include a function I haven't used before - implode. But I won't be forgetting to rename my lists with an extra []!
v2Media - I'll be tidying my coding up!
Once again, thanks!
mnewm