Skip to content

Commit

Permalink
Dev: pgsql fix for CSV CPDB import
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 10, 2016
1 parent bcafe69 commit 0e491ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/models/ParticipantAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ function getAttributeInfo($participantid)
}
function updateParticipantAttributeValue($data)
{
$query = Yii::app()->db->createCommand()->select('*')->where('participant_id="'.$data['participant_id'].'" AND attribute_id = '.$data['attribute_id'])->from('{{participant_attribute}}')->queryAll();
$query = Yii::app()->db->createCommand()->select('*')->where("participant_id='".$data['participant_id']."' AND attribute_id = ".$data['attribute_id'])->from('{{participant_attribute}}')->queryAll();
if (count($query) > 0)
{
Yii::app()->db->createCommand()
->update('{{participant_attribute}}', $data, 'participant_id = "'.$data['participant_id'].'" AND attribute_id = '.$data['attribute_id']);
->update('{{participant_attribute}}', $data, "participant_id = '".$data['participant_id']."' AND attribute_id = ".$data['attribute_id']);
} else {
Yii::app()->db->createCommand()
->insert('{{participant_attribute}}', $data);
Expand Down

0 comments on commit 0e491ee

Please sign in to comment.