I ask a similar question a little earlier but didn't get the exact answers I was looking for, or I did just more problems arose afterward.
Here's my original question:
http://answers.yahoo.com/question/index;_ylt=AqasyIF588vYIc3i2WdKOV_sy6IX;_ylv=3?qid=20080804085924AAo7GQs
I have the select form submitting information into the database but when viewing the field it created it displays "Array" instead of the value of the selected field (which is what I'm wanting it to display.
Here's some code I have for the form/php:
<? if ( $_POST['sendbutton'] ) { $sub = "1"; } ?>
<form enctype="multipart/form-data" action="<?php echo $PHP_SELF;?>" method="post" class="cform" id="cfo">
<?php
$region = $_POST['region'];
?>
<li id="li--3">
<label for="region"><span>Region</span></label>...
<select name="region" id="region" class="single" size="1">
<option value="" selected>Please Select One</option>
<option value="downtown">UT Area/Downtown</option>
<option value="north">North</option>
<option value="south">South</option>
<option value="east">East</option>
<option value="west">West</option>
</select>
</li>
<?php
mysql_query("INSERT INTO ".$db['prefix']."apartments (name, address, city, state, zip, description, phone, amenities, website, 1bed, 2bed, 3bed, 4bed, studio, timecode, additional, region) VALUES ('$name', '$address', '$city', '$state', '$zip', '$description', '$phone', '$amenities', '$website', '$br1', '$br2', '$br3', '$br4', '$studio', '".mktime()."', '$additional', '$region')") or die(mysql_error());
?>
</form>
Of course there's lot more code, but this is just little snippets I've extracted that I know the problem resolves around.
So basically once the form is submitted I need which value is selected on the select form to be sent into the database table's cell called region.
Again, it's currently displaying the text Array in the region column where I would like the value of the select option to be.
Thanks in advance.
Tags: