hemi519
07-15-2012, 03:37 PM
Hi All,
I am struck with checkbox array issue. Below is my code
if(isset($_POST['submit']))
{
$amount = $_POST['customerid'];
$agent = $_POST['name'];
$amount = $_POST['amount'];
// here i want to to update my table based on customerid. I am unable to pass the values in a loop to table
}
<table border = 1 align="center">
<?php
while($result = mysql_fetch_array($query))
{
?>
<tr>
<td bgcolor="#666666">
<input name="checkbox[]" type="checkbox" id="checkbox[]" value="0" />
</td>
<td align="center"><input name="customerid[]" type="text" id="customerid" value="<?php echo $result['customer_id']; ?>"></td>
<td align="center"><input name="name[]" type="text" id="name" value="<?php echo $result['name']; ?>"></td>
<td align="center"><input name="amount[]" type="text" id="amount" value=" "></td>
</tr>
<?php
}
?>
<input type="submit" name="submit" value="Submit" />
</table>
Anyone can help me in this issue.
I am struck with checkbox array issue. Below is my code
if(isset($_POST['submit']))
{
$amount = $_POST['customerid'];
$agent = $_POST['name'];
$amount = $_POST['amount'];
// here i want to to update my table based on customerid. I am unable to pass the values in a loop to table
}
<table border = 1 align="center">
<?php
while($result = mysql_fetch_array($query))
{
?>
<tr>
<td bgcolor="#666666">
<input name="checkbox[]" type="checkbox" id="checkbox[]" value="0" />
</td>
<td align="center"><input name="customerid[]" type="text" id="customerid" value="<?php echo $result['customer_id']; ?>"></td>
<td align="center"><input name="name[]" type="text" id="name" value="<?php echo $result['name']; ?>"></td>
<td align="center"><input name="amount[]" type="text" id="amount" value=" "></td>
</tr>
<?php
}
?>
<input type="submit" name="submit" value="Submit" />
</table>
Anyone can help me in this issue.