1.nodejsでDBをselectした結果をconsole.logで表示する
const Result = await execute(SQL, Args); console.log(Result)
・console の出力結果
[
RowDataPacket {
code: '7297',
product_name: 'BOXハッピーサマー',
case_count: '50',
price: '74',
}
]
//RowDataPacketという文字を表示する
2. RowDataPacketは無視する
・MDN,MozillaでRowDataPacketを検索してもRowDataPacketが引き当たらないので、一瞬悩んだ
3.データへのアクセス
const Result = await execute(SQL, Args); let code = Result[0].code; let product_name = Result[0].product_name; let case_count = Result[0].case_count: let price = Result[0].price;