Recently I got a problem with $_POST
method. Here is select attribute in HTML that is giving informations by POST method.
<select name="date_year[]" required>
<option value="" selected="selected" disabled="true">Choose year...</option>
<option value="07"> 2007</option>
<option value="08"> 2008</option>
<option value="09"> 2009</option>
<option value="10"> 2010</option>
<option value="11"> 2011</option>
<option value="12"> 2012</option>
<option value="13"> 2013</option>
<option value="14"> 2014</option>
<option value="15"> 2015</option>
<option value="16"> 2016</option>
<option value="17"> 2017</option>
<option value="18"> 2018</option>
<option value="19"> 2019</option>
<option value="20"> 2020</option>
</select>
after submiting form with this select tag, in PHP code I have something like this:
$month_date = $_POST['date_month'];
$year_date = $_POST['date_year'];
$final_date = $month_date . ' '. $year_date;
$esult = $connection->query("SET NAMES 'utf8'");
if($connection->query("INSERT INTO thread VALUES (NULL, '$name', '$final_date', '$desc', '$thumbnail', '$gallery_img')")) {
unset($_POST['upload']);
header('Location: panel.php');
$connection->close();
exit();
}
Here just look for these $_POST
things. I just gave the full code for the context. Here is my problem: after a successfull insert to my MySQL database, I got the value "Array Array". From curiosity I echo'ed that $final_date
but still, it's just 'Array Array'. Why?