$ids = explode(",", $ids); // Доопустим $ids слева это строка "3,5,15,33,47"
// разложили ids по массиву
$in = str_repeat('?,', count($ids) - 1) . '?';// по шаблонку повторили знак вопроса????? "?,?,?,?,?"
// $in = "?,?,?,?,?"
return $this->db->row("SELECT * FROM cources WHERE id IN (:in)", ['in' => $in]);
SELECT * FROM cources WHERE id IN ("?,?,?,?,?")
Error: ENOENT: no such file or directory, open 'C:\Users\adeke\Desktop\comCatcher\results\980524420063_2019-9-5_0:2:50.txt'
at Object.openSync (fs.js:448:3)
at Object.writeFileSync (fs.js:1248:35)
at saveFileSync (C:\Users\adeke\Desktop\comCatcher\index.js:33:8)
at Timeout.logECG [as _onTimeout] (C:\Users\adeke\Desktop\comCatcher\index.js:41:9)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'C:\\Users\\adeke\\Desktop\\comCatcher\\results\\980524420063_2019-9-5_0:2:50.txt'
}
Error: ENOENT: no such file or directory, mkdir
at Object.mkdirSync (fs.js:806:3)
at saveFileSync (C:\Users\adeke\Desktop\comCatcher\index.js:29:8)
at Timeout.logECG [as _onTimeout] (C:\Users\adeke\Desktop\comCatcher\index.js:40:9)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7) {
errno: -4058,
syscall: 'mkdir',
code: 'ENOENT'
}
const resultDir = './results/';
// ...
try{
fs.writeFileSync(resultDir + filename, text);
} catch (e) {
console.log(e);
}
Error: ENOENT: no such file or directory, open './results/980525350063_2019-9-4_22:33:50.txt'
at Object.openSync (fs.js:448:3)
at Object.writeFileSync (fs.js:1248:35)
at Timeout.logECG [as _onTimeout] (C:\Users\adeke\Desktop\comCatcher\index.js:30:12)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: './results/980525350063_2019-9-4_22:33:50.txt'
}