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
The same article is being fetched from the DB thrice if I do the following:
View an article
Like it
Unlike it
Instead of making three DB calls here, reduce it to just one, and keep the article in memory while it is being viewed, and update the DB with the like/dislike count once the user leaves the page. This would reduce load on the server.
The text was updated successfully, but these errors were encountered:
Great work, BTW. It is a pretty good system, considering it is written from scratch. You are sanitizing the input and SQL queries, and are validating the stuff that needs to be validated. Really nice to see 👍
Thank you for your inputs. Will work on converting the code to object oriented. Need to make a system so that a particular user cannot like/dislike an article more than once.
The same article is being fetched from the DB thrice if I do the following:
Instead of making three DB calls here, reduce it to just one, and keep the article in memory while it is being viewed, and update the DB with the like/dislike count once the user leaves the page. This would reduce load on the server.
The text was updated successfully, but these errors were encountered: