updating a field in the same record

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

updating a field in the same record

Post by hannesk »

I'm a newbie :(

I'm trying to update one field with the content of others.
with row updating - I have the following code:

function Row_Updating($rsold, &$rsnew) {
// Enter your code here
// To cancel, set return value to FALSE
$uu=$rsnew["id"];

$aa1=$rsnew["tanav"];
$aa2=$rsnew["majanr"];

$bb4=rtrim($aa1);
$bb5=rtrim($aa2);
$kokku="$bb4 $bb5";
$this->aadress_kokku->ViewValue=$kokku;
return TRUE; }

the field called "address_kokku" is not updated.

I tried with UPDATE SQL command, but as I'm updating - I don't get unique id from the table (id is auto increment field in mysql) and the value of id is constantly 0

Any suggestions?


mobhar
User
Posts: 11761

Post by mobhar »

Change this:
$this->aadress_kokku->ViewValue=$kokku;

become:
$rsnew["aadress_kokku"] = $kokku;


hannesk
User
Posts: 4

Post by hannesk »

thanks Mobhar!

It works!


Post Reply