Hi,
error occurs on executing INSERT query. Here is SQL code:
INSERT INTO Search VALUES(9, 10, 'Get started with Gmail Gmail is built on the idea that email can be intuitive, efficient, and\nuseful. And maybe even fun.\n\nLabels instead of folders\nLabels do the work of folders with an extra bonus: a conversation can have\nseveral labels, so you\'re not forced to choose one particular folder. Learn\nmore<http://mail.google.com/support/bin/answer.py?answer=118708&hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en>\n\n Archive instead of delete\nYou shouldn\'t ever have to throw things away. Archiving moves messages out\nof your inbox and into \"All Mail,\" so they don\'t clutter your inbox but\nremain searchable in case you ever need them again. Learn\nmore<http://mail.google.com/support/bin/answer.py?answer=6576&hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en>\n\n Conversation view\nGmail groups emails and their replies in your inbox, so you always see your\nmessages in the context of your conversation. Related messages are stacked\nneatly on top of each other, like a deck of cards. Learn\nmore<http://mail.google.com/support/bin/answer.py?answer=5900&hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en>\n\n Chat and video chat\nYou don\'t have to use another program -- chat is built right into Gmail. Learn\nmore<http://mail.google.com/support/bin/answer.py?answer=33781&hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en>\nYou can even talk face to face with voice and video chat. All you need is a\nwebcam and a small\ndownload<http://mail.google.com/videochat?hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en>that\ntakes seconds to install.\n\n Learn more<http://mail.google.com/mail/help/intl/en/intro.html#utm_source=wel-eml&utm_medium=eml&utm_campaign=en>about\ngetting started with Gmail.\n\nWelcome!\n\n- The Gmail Team\n\n ', 9)
And code which executes a command:
foreach ($this->attributes as $attribute) {
$index .= $this->getOwner()->{$attribute}.' ';
}
$index = Yii::app()->db->quoteValue($index);
if ($this->getOwner()->isNewRecord) {
$sql = "INSERT INTO Search VALUES($id, $type, $index, $companyId)";
} else {
$sql = "UPDATE `Search` SET `index`= $index WHERE recordId = $id and recordType = $type and companyId = $companyId";
}
$command = Yii::app()->db->createCommand($sql);
$command->execute();
It throws an exception: “CDbCommand failed to execute the SQL statement: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound” but I haven’t specified any parameters. Why does it throw exception?
Thanks