Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#828130
hi,

I found something might be interested.
I create this trigger:
Code: Select all
function test_function($USERNAME)
{
	$query = "SELECT USR_UID FROM USERS WHERE USR_USERNAME = '$USERNAME'";
	$res = executeQuery($query);
	@@DeptHeadUID = $res['USR_UID'];
}

function test_function2()
{
	$query = "SELECT USR_UID FROM USERS WHERE USR_USERNAME = 'GianYagami'";
	$res = executeQuery($query);
	@@DeptHeadUID = $res['USR_UID'];
}

function foo(){
	return 2 + 2;
}

foo(); //he's cool

//test_function('GianYagami'); //he's not cool

//test_function2(); //this dude also not cool

//$array = new array("USERNAME" = "31406193");
//test_function3($array); //i forgot to make this one, lol
modify dynaform variable inside of user created function makes the code error, I am using PM 3.3
#828145
Hi,
You must change your codes like this:
Code: Select all
function test_function($USERNAME)
{
	$query = 'SELECT USR_UID FROM USERS WHERE USR_USERNAME = "'.$USERNAME.'"';
	$res = executeQuery($query);
	return $res['USR_UID'];
}

@@DeptHeadUID = test_function('GianYagami');
or 
@@DeptHeadUID = test_function(@@USER_LOGGED);
Please check the following link:
http://pmlearning.info/plugins.php
CRUD and Process

Liliana i want to hear your answer if i say "[…]

Enabling SQL Server in Windows

I’m excited to uncover this page. I need to […]

Hi, Please use query like this: SELECT Forneced.[…]

Casos estão carregando em branco

Boa tarde! Prezados, estou com problemas em algun[…]