Okay briefly I would like to say whats my problem with the code I have. The code below uploads image data into mysql database beautifully except with one barrier. On the form I have, people can upload up to 4 images. Now, the code below inserts four different rows. Each image 1 row. but the title for all four rows is the same because it belongs to same post. Is there anyway I can do a comma delimited insertion so that all four images for the single post be in one row?
<?php
if(isset($_POST['submitting']))
{
if(isset($_FILES['file_array']))
{
$user = $_SESSION['user_id'];
$pname = $_POST['Product_Name'];
$ProPrice = $_POST['Product_fee'];
$n_array = $_FILES['files_array']['name'];
$tmp_name_array = $_FILES['files_array']['tmp_name'];
$type_array = $_FILES['files_array']['type'];
$size_array = $_FILES['files_array']['size'];
$error_array = $_FILES['files_array']['error'];
for($i = 0; $i < count($tmp_name_array); $i++)
{
if(move_uploaded_file($tmp_name_array[$i], "data/profile/posted_data/".$n_array[$i]))
{
$query = mysqli_query($conn, "INSERT INTO posts (userid, post_title, file, type, size, image_date) VALUES ('$user', '$pname', '$n_array[$i]', '$type_array[$i]', '$size_array[$i]', now())");
echo '<div class="form_message_box">' . $n_array[$i] . ' ' . 'Uploaded Successfully' . '</div>' . '<br>';
if($query)
{
echo '' . '<br>';
}
else
{
echo 'failed!' . '<br>';
}
}
}
}
}
?>
$posts = "SELECT * FROM posts WHERE userid='$user'";
$posts_result = mysqli_query($conn, $posts);
$res = mysqli_num_rows($posts_result);
while ($posts_result_rows = mysqli_fetch_assoc($posts_result)) {
$post_image = $posts_result_rows['files'];
}
<tr>
<td width="220">
<?php
<img src="<?php echo "data/profile/posted_data/".$post_image; ?>" width="220" height="220"><hr>
</td>
</tr>
<?php
}
echo "</table>";
?>

post_titleand would just index it to that table. And they way you store files right now is correct.