Yii Framework Forum: MySQL bindvalue for binary column - Yii Framework Forum

Jump to content

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

MySQL bindvalue for binary column

#1 User is offline   AlbertK 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 22-September 14

Posted 21 April 2017 - 05:29 AM

Hi

I have tried to bindvalue a binary string but the PDO is not passing the binary value to the procedure, What am I missing here? If change the input parameter for my getdatapressure to varchar and i change the
bindValue(':uid' , hex($datamodel->getkey($id))) 
, it worked.

May I know how to pass the raw binary without convertion? Thank you.


public function actionDatapressure($date_req,$id)

{
		
		$datamodel = new DataKey();

		// $datamodel->getkey($id) will return uuid(binary(16) datatype) from a mysql table.

		$command = Yii::$app->db->createCommand("CALL getdatapressure(:uid,:dateR)")

		->bindValue(':uid' ,  $datamodel->getkey($id) )
							
		->bindValue(':dateR', $date_req)

		->queryAll();
				
		return $command;
				

}

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