Finally adding comments to my blog
Published on August 29, 2025Oh boy I said that I was going to add comments way back in February and I even attempted but gave up when I had more time to do it right but today I had time and time will tell if I did it right (lol she be right mate).
I had to learn to PHP SQL and I also had to struggle with Nginx configs and update every page. PHP is being used to interact with the SQL database such as
Displaying comments:
SELECT username, comment_text, created_at FROM comments WHERE post_slug='pi-pico-game' ORDER BY created_at DESC;
Posting new comments:
INSERT INTO comments (username, comment_text, post_slug) VALUES ('Gideon', 'This is my comment', 'pi-pico-game');
Logging in and logging out:
PHP handles user authentication by querying the users table and verifying passwords. (there isn't a way to make a new account yourself yet if you really want to comment send me an email with a username and password (or just a username and I'll come up with a password for you) ;P)
The SQL database is called blog comments. Inside it, are two tables:
users – stores users
And
comments – stores comments for each blog post.
I'll add a way to make your own accounts at some point… maybe.
Until then have a good day bye! 👋
Please login to leave a comment.