req.query[field]); if (existingParams.length !== 0) { sql += ' WHERE '; sql += existingParams.map(field => `${field} = ?`).join(" AND "); } ... provides me this: SELECT * from users WHERE active = ? AND name = ? LIMIT 100 I'm getting an error though ... since the column name in the database is defined 'last_name' ... so I want to end up with sth like this: SELECT * from users WHERE active = ? AND last_name = ? LIMIT 100 ... but keep the search parameter in the url 'name'. How co I need to alter my script?..."/>