User attribute returned or processed incorrectly.
Permalink
I am having users input some data which I am storing in their attributes. Some of these are working, some are not.
In all, I am asking 60 questions. It is apparent, some of the data being returned is incorrect. For example.
This returns 1, when it is storing 6.
Any idea what I may be doing wrong?
In all, I am asking 60 questions. It is apparent, some of the data being returned is incorrect. For example.
use Concrete\Core\User\UserInfo; $ui = UserInfo::getByID(3); $answer = $ui->getAttribute('Q1'); print (int)$answer;
This returns 1, when it is storing 6.
Any idea what I may be doing wrong?
I've found if I don't typeset, it returns 6. However, when I compare...
This isn't evaluating to true.
use Concrete\Core\User\UserInfo; $ui = UserInfo::getByID(3); $answer = $ui->getAttribute('Q1'); if ($answer >= 5) print "True";
This isn't evaluating to true.
The solution was:
$answer = $ui->getAttribute('Q1').'';
$answer = $ui->getAttribute('Q1').'';
Try this