noboost4you
07-30-2008, 03:27 PM
Workers populate one specific table/database with product that is due in.
Once the product is received, I want the receiving department to go down the list, check the box under the Received column that populates with every entry, and hit the "Received" button at the button of the page. From that request, I want each row that was "checked" to be deleted from the first table/database and inserted into another table/database with one additional field that wasn't present in the first table/database (current date stamp).
I've been able to do check the boxes, receive, and have the rows deleted from the first table and inserted into the second table, but because I want to throw a date stamp on when the items were received, I'm at a standstill.
Here is the code I'm working with:
<?php
$con = mysql_connect("IP", "USER", "PASS");
if (!$con)
{
die('Could not connect: ' .mysql_error());
}
mysql_select_db("expedite", $con);
if ($_POST['archive'])
{
foreach($_POST['archive'] as $key => $RequestNum)
{
$archive=("INSERT INTO archive SELECT * FROM request WHERE RequestNum='".(int)$RequestNum."'") or die(mysql_error());
$del=("DELETE FROM request WHERE RequestNum='".(int)$RequestNum."'") or die(mysql_error());
mysql_query($archive);
mysql_query($del);
echo "<center><body bgcolor='#E1E1E1'><font face='arial'>";
echo "Record Added to Received Database";
echo "<META HTTP-EQUIV='Refresh' CONTENT='2; URL=result.php'>";
}
}
else
{
echo "<center><body bgcolor='#E1E1E1'><font face='arial'>";
echo "Please select at least one row to receive";
echo "<META HTTP-EQUIV='Refresh' CONTENT='2; URL=result.php'>";
}
mysql_close($con)
?>
How can I throw a date stamp into that equation?
Thanks
Once the product is received, I want the receiving department to go down the list, check the box under the Received column that populates with every entry, and hit the "Received" button at the button of the page. From that request, I want each row that was "checked" to be deleted from the first table/database and inserted into another table/database with one additional field that wasn't present in the first table/database (current date stamp).
I've been able to do check the boxes, receive, and have the rows deleted from the first table and inserted into the second table, but because I want to throw a date stamp on when the items were received, I'm at a standstill.
Here is the code I'm working with:
<?php
$con = mysql_connect("IP", "USER", "PASS");
if (!$con)
{
die('Could not connect: ' .mysql_error());
}
mysql_select_db("expedite", $con);
if ($_POST['archive'])
{
foreach($_POST['archive'] as $key => $RequestNum)
{
$archive=("INSERT INTO archive SELECT * FROM request WHERE RequestNum='".(int)$RequestNum."'") or die(mysql_error());
$del=("DELETE FROM request WHERE RequestNum='".(int)$RequestNum."'") or die(mysql_error());
mysql_query($archive);
mysql_query($del);
echo "<center><body bgcolor='#E1E1E1'><font face='arial'>";
echo "Record Added to Received Database";
echo "<META HTTP-EQUIV='Refresh' CONTENT='2; URL=result.php'>";
}
}
else
{
echo "<center><body bgcolor='#E1E1E1'><font face='arial'>";
echo "Please select at least one row to receive";
echo "<META HTTP-EQUIV='Refresh' CONTENT='2; URL=result.php'>";
}
mysql_close($con)
?>
How can I throw a date stamp into that equation?
Thanks