close ad
Help us test the new Databridge BETA with MySQLi support
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 Jason Byrnes | 839 views | 3 replies |


Error Updating two different tables

My problem is that I have a database with two tables. I simply want to update each table independent of the other. It give error after I run the Dataassist Wizard for each of the tables. The Update page for the second table always has error with the SQL.

Sign in to reply to this post

Jason ByrnesWebAssist

what is the text of the error message?

also, send a copy of your page so I can look at the code.

Sign in to reply to this post


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
Sign in to reply to this post

Jason ByrnesWebAssist

an update behavior can only update one table.

you would need to have 2 update behaviors in place to update the 2 tables.

Sign in to reply to this post

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





Ease of use


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...