 |
|
รบกวนหน่อยค่ะ จะส่งค่า array ใน Datatable ไปในaction form ยังไงให้ค่าออก
ลอง Print_f แล้วค่าไม่ออกเลยค่ะ

Code (PHP)
<form id="form1" action="process.php" method="post" >
<table id="example" class="table table-bordered table-hover" >
<thead>
<tr>
<th>No</th>
<th>Code</th>
<th>Description</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT count(id_data ) FROM t_data WHERE (name = '$name') ";
$query=odbc_exec($link,$sql);
$num=odbc_result($query,1);
$sql_a="SELECT * FROM t_data WHERE (name = '$name') ";
$query1=odbc_exec($link,$sql_a);
for($p=1;$p<=$num;$p++) {
$rows=odbc_fetch_array($query1);
$id = $rows['id'];
$id_a = $rows['id_a'];
$txt = $rows['txt'];
$name = $rows['name'];
?>
<tr>
<td> </td>
<td><?php echo $id; ?></td>
<td><?php echo $name; ?></td>
<td align = "center"><input type="checkbox" name="r2[]" id="r2[]" value="<?php echo $id_a; ?>" ></td>
<input type="hidden" name="user" id="user" value="<?php echo $user; ?>">
</tr>
<?php
}
?>
</tbody>
</table>
<button type="submit" id="submit" name="submit" class="btn btn-success ">
</form>
<script>
$(function () {
$('#example').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
});
</script>
process.php
print_r($_POST);
Tag : PHP, HTML, CSS, JavaScript, Action Script, Ajax
|
ประวัติการแก้ไข 2021-11-09 14:10:32
|
 |
 |
 |
 |
Date :
2021-11-09 14:09:17 |
By :
mewhappy |
View :
618 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |