I have a drop down list that is passing the value "Array" back to the script. Any ideas why? Here is the code. function dump_array($array_name){ switch (gettype($array_name)){ case 'integer': case 'double': case 'string': echo "it's a string"; echo $array_name; break; case 'array': echo '<table border="1">\n'; do { echo '<tr><td align="left" valign="top">'; echo key($array_name); echo '</td><td>'; dump_array($array_name[key($array_name)]); echo '</td></tr>'; } while (next($array_name)); echo '</table>'; break; default: echo 'Unknow data type.'; break; } } /* ** Associate with departments. */ if ($continueScript) { dump_array ($inputDepartment); for($index = 0; $index < count($inputDepartment); $index++) { $Query = "INSERT INTO department_item VALUES ("; $Query .= intval($inputDepartment[$index]) . ", "; $Query .= intval($item); $Query .= ")"; if(!mysql_query($Query, $DatabaseLink)) { $ActionResults[] = mysql_errno() . ": " . mysql_error() . " Query was: $repeatQuery"; $continueScript = FALSE; } } } returns "This is a string Array", The drop down list is below. <TR><TD>Department</TD> <TD><SELECT NAME="inputDepartment[]" MULTIPLE SIZE="5"> <OPTION VALUE="1">PC Hardware </option> <OPTION VALUE="3"> CPUs/Processors </option> <OPTION VALUE="4"> Printers </option> <OPTION VALUE="5"> Input Devices </option> <OPTION VALUE="15"> Mouse </option> <OPTION VALUE="6"> Monitors </option> <OPTION VALUE="7"> Modems </option> <OPTION VALUE="8"> Multimedia </option> <OPTION VALUE="9"> Scanners </option> <OPTION VALUE="10"> Cases </option> <OPTION VALUE="11"> Mainboards </option> <OPTION VALUE="12"> Memory </option> <OPTION VALUE="13"> Harddrives </option> <OPTION VALUE="14"> CDRom Drives </option> <OPTION VALUE="2">PC Software </option> <OPTION VALUE="16">Notebooks </option> <OPTION VALUE="17">Network Hardware </option> </SELECT> </TD></TR> Thanks, Chuck ============================================== Charles Williams (Owner) Accent Computer & Network Services Markt 2 D-95679 Waldershof Tel: +49 (0) 9231 972670 Fax: +49 (0) 9231 972671 http://www.acns-online.com GB/CS/O/U d-- -p+ c+++ l++ u- e+ m+ s++/ !n h---- f !g w++ t+ r x** ============================================== **************Email Confidentiality Footer************** The information contained in this email and any attachments is intended for the named recipients only. It may contain privileged and confidential information and if you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this email in error, please return it to the originator advising of the error and delete all copies from your system. -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-WIN] Array from drop down list passing as string
Charles Williams \( CEO ACNS \) Fri, 02 Mar 2001 01:57:42 -0800