rahul23
(Rahuldeora1992)
1
SQLSTATE[23000]: Integrity constraint violation: 1052 Column ‘title’ in where clause is ambiguous
can you help me:
if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where(‘0=1’);
return $dataProvider;
}
$query ->joinWith(‘location’);
$query ->joinWith(‘programCategory’);
$query ->joinWith(‘duration’);
$query ->joinWith(‘airport’);
$query->andFilterWhere([
‘program_id’ => $this->program_id,
]);
$query->andFilterWhere([‘like’, ‘title’, $this->title])
->andFilterWhere([‘like’, ‘location.city’, $this->location_id])
->andFilterWhere([‘like’, ‘program_category.program_category_name’, $this->category_id])
->andFilterWhere([‘like’, ‘duration.type’, $this->duration_id])
->andFilterWhere([‘like’, ‘airport.city’, $this->airport_id]);
return $dataProvider;
}
rupsk1607
(Webin2015)
2
In join u have to specity table name with attributes.
if "title" is related to post table then u have to write post.title.
if field names of title is in two tables, plz denote the which table you have to search,
eg…,
$query->andFilterWhere(['like', 'tablename_1.title', $this->title])