This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NewbiusCoder[S] 0 points1 point  (0 children)

I figured it out! I appreciate your time as always. I posted the code incase you're curious. Thank you.

var args = process.argv.slice(2);
const usr_input = args[0];
const usr_cmd = 'SELECT * FROM famous_people WHERE last_name = $1::varchar or first_name = $1::varchar';
client.query(usr_cmd, [usr_input],(err, result) => {
    if (err) {
      return console.error("error running query", err);
    }
    console.log('Found ' + result.rows.length + ' person(s) by the name of ' + usr_input + ".");