What Will Be The Criteria To Search A Mysql Row With Field Having Newline At The End.

Hi,

I have a mysql table that looks like -

±--------±--------±------------------------------------------±----------±----------------------±--------------------+

| id | smsId | messageId | accountId | formattedMobileNumber | createdOn |

±--------±--------±------------------------------------------±----------±----------------------±--------------------+

| 447 | 1968447 | 00590000000OgXXAA0-ecf373afa658 | 80000434 | | 2012-11-07 17:17:00 |

| 1326548 | 4997307 | 2122547293271298157-157999821110989927

| 1 | 919920966433 | 2012-11-10 09:16:22 |

| 1326519 | 4997278 | 2122547283360407662-256960247621255639

| 1 | 919819210971 | 2012-11-10 09:16:21 |

±--------±--------±------------------------------------------±----------±----------------------±--------------------+

Now I want to find a row by searching the messageId,

So I have written -

[indent]

$messageId = "00590000000OgXXAA0-ecf373afa658";

$criteria=new CDbCriteria;

$criteria->condition=‘messageId=\’’.trim($messageId).’\’’;

$smsSnapshotForSearchModel=SmsSnapshotForSearch::model()->find($criteria);

if($smsSnapshotForSearchModel!=null){

[indent]

Yii::log(‘Record found in snapshot’,‘info’,‘info’);

[/indent]

}

[/indent]

It works fine and I can see the log. But when I try to search the other messageId’s I can’t. How do I define a criteria and search such results without worrying about the newlines at the end.

Please help.