Hi Jason,
Did this thread ever continue on? I have been looking for a solution for a similar situation where I can update an order or delete all or part of the order. When I create an update server behavious in DW how do i get it to recognize the two tables?
I have tried "join" and a few other things but with varying results.
This is what i have now but i get an error stating "Query Was empty"
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "UpdateOrder")) {
$updateSQL = sprintf("UPDATE orders INNER JOIN orderdetails ON orders.OrderID = orderdetails.DetailOrderID SET orderdetails.DetailName=%s, orderdetails.DetailPrice=%s, orderdetails.DetailQuantity=%s, orders.OrderAmount=%s, orders.OrderShipName=%s, orders.OrderShipAddress=%s, orders.OrderShipAddress2=%s, orders.OrderCity=%s, orders.OrderState=%s, orders.OrderZip=%s, orders.OrderPhone=%s, orders.OrderEmail=%s WHERE orderdetails.DetailOrderID = %s AND orders.OrderID = %s",
// conected to order details table
GetSQLValueString($_POST['DetailName'], "text"),
GetSQLValueString($_POST['DetailPrice'], "int"),
GetSQLValueString($_POST['DetailQuantity'], "int"),
// contected to orders table
GetSQLValueString($_POST['OrderAmount'], "int"),
GetSQLValueString($_POST['OrderShipName'], "text"),
GetSQLValueString($_POST['OrderShipAddress'], "text"),
GetSQLValueString($_POST['OrderShipAddress2'], "text"),
GetSQLValueString($_POST['OrderCity'], "text"),
GetSQLValueString($_POST['OrderState'], "text"),
GetSQLValueString($_POST['OrderZIP'], "text"),
GetSQLValueString($_POST['OrderPhone'], "text"),
GetSQLValueString($_POST['OrderEmail'], "text"),
GetSQLValueString($_POST['OrderID'], "int"));
mysql_select_db($database_t0y0t1r3s, $t0y0t1r3s);
$Result1 = mysql_query($updateSQL, $t0y0t1r3s) or die(mysql_error());
I'll keep looking/working at it but if you have a quick fix ... thank you.