Hi all,

I am getting result in an array from some webservice and i have created User Interface to see these results with each result have a check box with it.

what i want to do is to insert only that record in DB that user will check in check box.

Is there any way to do that.

<tr>
<td align='center'><input type='checkbox' name='chk0' value=''/></td>
<td align='center'>1</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>4</td>
<td align='center'>100</td></tr>
<tr>
<td align='center'><input type='checkbox' name='chk1' value=''/></td>
<td align='center'>66</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>66</td>
<td align='center'>40</td></tr>
<tr>
<td align='center'><input type='checkbox' name='chk2' value=''/></td>
<td align='center'>99</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>19</td>
<td align='center'>167</td></tr>
<tr>
<td align='center'><input type='checkbox' name='chk3' value=''/></td>
<td align='center'>6</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>44</td>
<td align='center'>555</td></tr>

User will check the check box against the record they want to insert in db and hit submit button.so all those records will go in db.there are four fields in Db table.

Thanks in advance.
jyotiu

Recommended Answers

All 2 Replies

When you call the the Database, are you using a SELECT statement and a WHERE clause?? If so, what is it?

Hi all,

I am getting result in an array from some webservice and i have created User Interface to see these results with each result have a check box with it.

what i want to do is to insert only that record in DB that user will check in check box.

Is there any way to do that.

<tr>
<td align='center'><input type='checkbox' name='chk0' value=''/></td>
<td align='center'>1</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>4</td>
<td align='center'>100</td></tr>
<tr>
<td align='center'><input type='checkbox' name='chk1' value=''/></td>
<td align='center'>66</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>66</td>
<td align='center'>40</td></tr>
<tr>
<td align='center'><input type='checkbox' name='chk2' value=''/></td>
<td align='center'>99</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>19</td>
<td align='center'>167</td></tr>
<tr>
<td align='center'><input type='checkbox' name='chk3' value=''/></td>
<td align='center'>6</td>
<td align='center'>Dell Home_GenericLogo 88x31&nbsp;</td>
<td align='center'>44</td>
<td align='center'>555</td></tr>

User will check the check box against the record they want to insert in db and hit submit button.so all those records will go in db.there are four fields in Db table.

Thanks in advance.
jyotiu

change your name='chk0'

into an array name=chk[]

call all the values from this code.

$chk=$_POST['chk'];

while (list ($key,$val) = @each ($chk)) {
echo "$val,";
} 

you can manipulate your values for every checkbox.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.