Welcome Guest, Not a member yet? Register   Sign In
Multiupload image width descreption image...???
#1

[eluser]memVN[/eluser]
now I think i want to add some fields for the image, like title and description…
Do anyone have idea how to loop array of fields and insert it into database..
For example:
image1 - title1 - desc1
image2 - title2 - desc2
image3 - title3 - desc3
Code:
<input type="text" name="pic_title[]" value="" />
<textarea name="pic_desc[]"></textarea>

<input type="text" name="pic_title[]" value="" />
<textarea name="pic_desc[]"></textarea>

<input type="text" name="pic_title[]" value="" />
<textarea name="pic_desc[]"></textarea>
#2

[eluser]memVN[/eluser]
Who can help me.?????????
#3

[eluser]Derek Allard[/eluser]
Hi memVN, I've moved your post to a different forum.

Let's start by modifying your example a bit
Code:
<input type="text" name="pic_title[1]" value="" />
<textarea name="pic_desc[1]"></textarea>

<input type="text" name="pic_title[2]" value="" />
<textarea name="pic_desc[2]"></textarea>

<input type="text" name="pic_title[3]" value="" />
<textarea name="pic_desc[3]"></textarea>

Now let's take the db out of the equation for a moment, if you had your above example submitted, what would your controller code look like to just echo out to the screen all of the pic_titles?




Theme © iAndrew 2016 - Forum software by © MyBB