I need the user to insert multiple images into database through a form. I succeded to make one image insert. Here is the code:
$insert_sql = "INSERT INTO my_tbl VALUES ('' , \"$image\", \"$title\")";
<form name = "my_form" form action=" " enctype="multipart/form-data" method="post">
<div> Title: <input name="title" type="text" size="50" /></div>
<div"> Image: <input name="classnotes" type="file" value="" id="file"/></div>
<input name='submit' type='submit' id="submit-go" value='Upload'>
</form>
Now I need to insert several images so I tried to insert at least 3 images but didn't work out. Only last field's image inserts into the database. Anyhow I need to make it work. So, any help is appreciated.
<form name = "my_form" form action=" " enctype="multipart/form-data" method="post">
<div> Title: <input name="title" type="text" size="50" /></div>
<div"> Image: <input name="classnotes" type="file" value="" id="file"/></div>
<div> Title: <input name="title" type="text" size="50" /></div>
<div"> Image: <input name="classnotes" type="file" value="" id="file"/></div>
<div> Title: <input name="title" type="text" size="50" /></div>
<div"> Image: <input name="classnotes" type="file" value="" id="file"/></div>
<input name='submit' type='submit' id="submit-go" value='Upload'>
</form>