I am trying to query a MS-SQL db with the following code
$userid ="'{C8FF8835-D7A2-446D-98F9-F965102BB7B5}'";
$model = new User;
$model->findByAttributes(array('UserId'=>$userid));
but am getting an error from yii. I have tried
$userid ="C8FF8835-D7A2-446D-98F9-F965102BB7B5";
and other variations as well.
The above works with a different column search that is a plain integer or plain string.
It looks like the ’ is stripped off the variable before being passed into the query.
Does anyone know how to make this work with guid’s?