difficulty using Pre Eval - plugin update columns

angelogabeira

New Member
You must validate if a variable is filled before performing the update on the table.
For this I am using the "pre eval" function, having tried several alternatives.
1 example:
if (empty($msg_comunica___segmento))
2 example:
if (empty($msg_comunica___segmento)) {return false;}

Anyone know how to use this (pre eval)?
Can you help me?
 
Example : I am using the "pre eval" to validate if "booking___finish" element is not equal to 1
Code:
foreach ($data as $group) {
   foreach ($group as $row) {
   if((int)$row->booking___finish_raw==1){
   return false;
  
   }
  
   }
}
 
1) I tried like this

foreach ($data as $group) {
foreach ($group as $row) {
if($row->empty($msg_comunica___segmento)
{return false;}
}
}
and that was the error : 0 syntax error, unexpected 'return' (T_RETURN)

2)I tried like this

foreach ($data as $group) {
foreach ($group as $row) {
if(empty($msg_comunica___segmento)
{return false;}
}
}

and that was the error : syntax error, unexpected '{'
 
The error message is very clear: syntax error. A closing ) is missing in the if condition.
 
Sorry! You were right. A ')' was missing, however it still didn't work. Below is the code I'm using now.
no errors are presented but it does not validate


foreach ($data as $group) {
foreach ($group as $row) {
if(empty($msg_comunica___segmento))
{return false;}
}
}
 
Please compare your latest code with the replies to your earlier posts. Pretty obviously, there's still something wrong with your use of the variable you're checking on.
Can't say more because no idea where that's supposed to come from.
 
In case you're still stuck with this:
As indicated repeatedly since your first post, the variable $msg_comunica___segmento is still a mystery.
Where has it been defined? What is it, an array, a string/integer or whatever else?
The code "around" it depends on this, so without knowing where you have the variable from and what it is, or much more detail on the elements involved, it's hardly possible to help other than with the pointers you've already got, sorry.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top