Yii Framework Forum: Mssql Bindparam - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Mssql Bindparam Rate Topic: -----

#1 User is offline   smokeelow 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 02-December 12

Posted 03 February 2013 - 03:09 PM

I have query like this:
$query="UPDATE $table SET title=(N':title') WHERE id=':id'";

and I can't bind :title, cuz after
$command=Yii::app()->db->createCommand($query);

it's response like a string and I can't use bindParam on it.

Is it possible to do something with this?
0

#2 User is offline   smokeelow 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 02-December 12

Posted 03 February 2013 - 03:22 PM

so stupid... <_<

I resolved this issue in this way:
$query="UPDATE $table SET title=(N?) WHERE id=':id'";
$command=Yii::app()->db->createCommand($query);
$command->bindParam(1,$title, PDO::PARAM_STR);

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users