The Script:
<?php
if(isset($_POST['submit'])) {
$some_text_1 = $_POST['some_text_1'];
$some_text_2 = $_POST['some_text_2'];
$some_text_3 = $_POST['some_text_3'];
$myarray = array($some_text_1, $some_text_2, $some_text_3);
for ($i = 0; $i < count($myarray); $i++) {
$tqs = "INSERT INTO `table` (`some_text`) VALUES ('" . $myarray[$i] . "')";
$tqr = mysqli_query($dbc, $tqs) or die(mysqli_error($dbc));
$tqs = "SELECT `id` FROM `table` WHERE `some_text` = '" . $myarray[$i] . "'";
$tqr = mysqli_query($dbc, $tqs) or die(mysqli_error($dbc));
$fetch_array[] = mysqli_fetch_array($tqr);
}
$fetch_array = implode(", ", $fetch_array);
?>
I am looking to insert the array into a row of a column like in this following example:
the_row: | 3, 4, 5, 6, 7
Though when using the implode function I am getting this error:
Notice: Array to string conversion in ... (points to the implode function)
Any suggestions on how to get this working?