ew_Execute on row rendered event

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
lhardee
User
Posts: 36

ew_Execute on row rendered event

Post by lhardee »

Hello,

I'm having trouble with the following issue. I have a table called 'test' where circuit IDs are listed and the customer name for each circuit ID is blank. I would like to compare my current table to another table called 'ioc' (which has the same circuitIDs and also customer names) to pull the customer name into my "test" table. Currently, I am trying with the following code:

function Row_Rendered() {

		   ew_Execute("UPDATE `test` SET customername= '$customername' WHERE `ioc.circuitid`= " . $this->circuitid->CurrentValue);

}

thanks,
lhardee


mobhar
User
Posts: 11761

Post by mobhar »

How about this?

ew_Execute("UPDATE test SET customername = '".$customername."' WHERE ioc.circuitid = " . $this->circuitid->DbValue);


Webmaster
User
Posts: 9430

Post by Webmaster »

$customername is not setup in the event. Check your code again.


danielc
User
Posts: 1601

Post by danielc »

lhardee wrote:
ew_Execute("UPDATE test SET customername= '$customername' WHERE ioc.circuitid=
" . $this->circuitid->CurrentValue);

If you want to update table.column from anothertable.column, try this in your Page_Load server event for your table List Page:
ew_Execute("UPDATE test, ioc SET test.customername = ioc.customername WHERE test.circuitid = ioc.circuitid");

Or you want to do it in Row_Rendered server event, you need to specify your tablename and use select clause to find the column value.


Post Reply