close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Error Updating two different tables

Thread began 7/29/2010 8:00 pm by xarx1001412051 | Last modified 6/07/2012 2:49 pm by xarx1001412051 | 818 views | 3 replies

rgolab68503

Updating two tables

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.

Attached Files
Order_Update.zip

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...