php - Form post not working in while loop result -
i'm pulling customer bookings database dependent upon date, seems working fine. decided add button within form, in table, send record invoicing page. seems work except first result in table. form post post invoicing page below first result, first result nothing, refresh page.
when looking @ source code looks correct, isn't working if there 1 result or doesn't work first result, if there more one. need use other while loop?
<?php $i=0; while ($i < $num) { $id = mysql_result($update4, $i, "id"); $booking_date = mysql_result($update4, $i, "booking_date"); $date = date("m/d/y", strtotime($booking_date)); $customer_name = mysql_result($update4, $i, "customer_name"); $customer_address = mysql_result($update4, $i, "customer_address"); $customer_city = mysql_result($update4, $i, "customer_city"); $starter1 = mysql_result($update4, $i, "start_time"); $starter = date("g:i a", strtotime("$starter1")); $ender1 = mysql_result($update4, $i, "end_time"); $ender = date("g:i a", strtotime("$ender1")); $start_timestamp = mysql_result($update4, $i, "start_ts"); ?> <tr> <td style="vertical-align: middle;"><?php echo $date; ?></td> <td style="vertical-align: middle;"><?php echo $starter; ?> - <?php echo $ender; ?></td> <td class="hidden-phone" style="vertical-align: middle;"><?php echo $customer_name; ?></td> <td class="hidden-phone" style="vertical-align: middle;"><?php echo $customer_address; ?></td> <td class="hidden-phone" style="vertical-align: middle;"><?php echo $customer_city; ?></td> <td style="vertical-align: middle; width: 5%;"><form action="invoiced.php?id=<?php echo $id; ?>" method="post"><button class="btn btn-large btn-primary" type="submit"><i class="icon-file-alt pull-left"></i>send invoice</button></form></td> </tr> <?php $i++; } ?>
Comments
Post a Comment