This topic is locked

Update Fields From Joined Tables

1/23/2013 2:27:47 PM
PHPRunner General questions
T
Tom16 author

Hi,
I have three joined tables. I want to be able to update the email field in j17_users.

I have the code below but I can't get it to work.

I have inserted the code in "Before record updated".
global $conn;

$sql = "update j17_users set j17_users.email='".$values["j17_users.email"]."' where id=".$keys["id"];

db_exec($sql,$conn); unset($values["j17_users.email"]);

return true;
Has anybody any ideas?
Tom

C
cgphp 1/23/2013

Check what is the real name of the email field. Try the following code:

global $conn;

$sql = "update j17_users set j17_users.email='".$values["email"]."' where j17_users.id=".$keys["id"];

db_exec($sql,$conn); unset($values["email"]);

return true;