Answer the question
In order to leave comments, you need to log in
How to make a nested query on a list id?
There is a table words with fields: id , word
id | word |
---|---|
111 | word 1 |
222 | word 2 |
333 | word 3 |
444 | word 4 |
555 | word 5 |
666 | word 6 |
id | word_id_1 | word_id_2 |
---|---|---|
one | 111 | 222 |
2 | 111 | 333 |
3 | 111 | 444 |
4 | 111 | 666 |
public function getDetailPage($id) {
$params = [
'id' => $id, // id из таблицы words
];
return $this->db->row('SELECT * FROM words WHERE id = :id', $params);
}
public function row($sql, $params = []) {
$result = $this->query($sql, $params);
return $result->fetchAll(PDO::FETCH_ASSOC);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question