I am using this statement below as a database query to MySQL. The Query works fine as far as retrieving the data from both the posts
and users
table, however when I log the query it also logs the password
column from my users
table. I would like to select specific columns from both the posts
and users
table that are produced from the specific query. I am not sure how the INNER JOINING of two tables is treated in MySQL
I was wondering if someone can show me how to properly format this so that the password
column is excluded from my results.
'SELECT * FROM posts INNER JOIN users ON posts.author = users.id WHERE posts.id = ?'
I am using NodeJS and MySQL so when I console.log I get this result
[ RowDataPacket {
id: 62,
title: 'This is the title',
body: 'This is the body ',
author: '62',
createdOn: 2018-02-23T02:20:24.000Z,
name: 'Andrew',
email: 'andrew.lee@gmail.com',
username: 'thexp',
password: '$2a$10$lfUj.JkuotihrXeYRVPoTuWWdWfGHnGdTSEzv8fhaSrPa3m98Vg.G' <---- I would like this to not show } ]
Any help is appreciated. Thanks!