You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dbConnection.query('SELECT posts.post_title, posts.post_body, users.name as posted_by, posts.date , posts.time FROM posts JOIN users ON users.user_id = posts.user_id ORDER BY posts.date desc;',
(err,result)=>{
if(err){
cb(err);
}else{
cb(null,result.rows);
}
});
Most of the lines in this code keep repeating in every query you write. The more lines you write the more likely you are to have bugs, the more difficult your code is to read, and the more time you take get the job done.
The text was updated successfully, but these errors were encountered:
w7-blogger/src/queries/getData.js
Lines 5 to 12 in c746911
Most of the lines in this code keep repeating in every query you write. The more lines you write the more likely you are to have bugs, the more difficult your code is to read, and the more time you take get the job done.
The text was updated successfully, but these errors were encountered: