How to enter value by Row_Inserting server event?

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

How to enter value by Row_Inserting server event?

Post by SOHIB »

Hello All
i am trying to use this code but the value does't entered to the feild
any help

function Row_Inserting($rsold, &$rsnew) {
	// Enter your code here
	// To cancel, set return value to FALSE
		$sname=$rsnew['sinagl_name'];
		$teamnames=$rsnew['othe_team'];
	
		if($sname!=NULL)
		{
		$rsnew['visitores_name']=$sname;
		}
		else
		{
		$rsnew['visitores_names']=$teamnames;
		}

	return TRUE;
}

sangnandar
User
Posts: 1031

Post by sangnandar »

You might want to check the actual sql fired to db, check if it's a valid sql for the insertion of that table.
My guess is you don't have field sinagl_name and othe_team in that table.
If that's the case you need to unset them

function Row_Inserting($rsold, &$rsnew) {
  // Enter your code here
  // To cancel, set return value to FALSE
  $sname=$rsnew['sinagl_name'];
  $teamnames=$rsnew['othe_team'];
	if($sname!=NULL)
	{
          $rsnew['visitores_name']=$sname;
	}
	else
	{
	  $rsnew['visitores_names']=$teamnames;
	}
  unset($rsnew['sinagl_name']);
  unset($rsnew['othe_team']);

  return TRUE;
}

Post Reply