View Full Version : Approve button inside while loop

04-19-2012, 10:58 AM

I have form which data is inside while loop and per row has a approved button, Now I have no idea that when I click the approve button the JO # from that row will display and save to the database.

here is my code and sample form.

date_default_timezone_set("Asia/Singapore"); //set the time zone
$con = mysql_connect('localhost', 'root','');

if (!$con) {
echo 'failed';

mysql_select_db("mes", $con);
$Date_Shelve =date('Y-m-d H:i:s');
<title>Sales Order</title>
<link rel="stylesheet" type="text/css" href="kanban.css" />
<form name="loading_kanban" action="" method="post">
<div id="SR_date">
<label>Date :</label>
<input type="text" name="Date_Shelve" id="Date_Shelve" value="<?php echo $Date_Shelve; ?>" size="16" readonly="readonly" style="border: none;">

<div id="kanban_table">
<th> JO No.</th>
<th> ETD </th>
<th> PO No. </th>
<th> SKU Code </th>
<th> Description </th>
<th> PO Req </th>
<th> Requirements </th>
<th> Priority</th>


$sql = "SELECT ETD, PO_No, SKUCode, Description, POReq
FROM sales_order";
$res_so = mysql_query($sql, $con);

while($row = mysql_fetch_assoc($res_so)){

$ETD = $row['ETD'];
$PO_No = $row['PO_No'];
$SKUCode = $row['SKUCode'];
$Description = $row['Description'];
$POReq = $row['POReq'];

echo "<tr>
<td><input type='button' name='priority' value='Approved' id='priority'></td>



04-19-2012, 01:46 PM
So what is the question?

04-20-2012, 07:48 AM
but you are aware that all PHP runs before the HTML is sent to the browser and when you have the page in the browser you cannot execute PHP?