Capture in an array the values received via checked checkbox post, these checkboxes have the values equal to the field names of the table, I need to query with while and print the fields referring to array:
<?php
$campos = '''.implode('', '', $_POST['check']).''';
$sql = mysql_query("SELECT id,$campos FROM chamado where status = 1");
while($busca=mysql_fetch_array($sql)){
?>
<tr class="odd gradeX">
<td width="2%"><?php echo $busca['id'];?></td>
<?php
foreach ($quantidade_item as $tags) {
echo '<td width="2%">'.$busca[$tags].'</td>';
}
?>
</tr>
<?php
}
?>
What happens is that when you run the code, if you check that only one checkbox has been checked, the listing appears normally, but if you check more than one checkbox, the list displays only the data in the first column, the other columns return me undefined index -