[SOLVED] Update a field from another table |
7/8/2010 2:56:22 AM |
PHPRunner General questions | |
![]() I want productname field updated based on ProductID
$sql = "UPDATE order_details SET ProductName='".$values["ProductName"]."' WHERE ProductId=" . $values["ProductId"];
|
|
A
|
ann 7/8/2010 |
Hi, |
![]() |
romaldus author 7/8/2010 |
Hi, to fill ProductName field based on the value of ProductID set up ProductName field as dependent dropdown (Lookup Wizard tab on the Edit as settings dialog on the Visual Editortab). Check the tutorial ('How to setup dependent dropdown boxes on Edit/Add pages'): http://xlinesoft.com/phprunner/php-database.htm Choose Edit box with AJAX popupoption if needed.
|
L
|
lucas 7/8/2010 |
Thanks Ann. We have been using dependent dropdown features in PHPRUNNER since the previous releases of the software. BTW i have some reason to avoid using it in particular situation, for example when working with a large database, lookup more than 20000 record (ProductID) using dependent dropdown with low bandwidth connection sometimes pain. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51081&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> As you see from the screenshot, i made the ProductName field as a READ ONLY field (i want the ProductName updated automatically each time a record inserted to database). cheers
|
A
|
ann 7/9/2010 |
Hi, |
![]() |
romaldus author 7/13/2010 |
Hi, you can fill in these value using 'Insert a record into another table' predefined action (Add action button on the Events tab) in the After record added event on the Events tab. Although it will be progressed after you click the save button.
$sql = "UPDATE order_details SET ProductName =(SELECT ProductName FROM products WHERE ProductID=ProductID)"; |