---
title: "Comment by Nicolás Parada on \"Introduction to Golang: build a mini Twitter clone\" | Hashnode"
description: "dbQuery := &quot; SELECT users.user_id, users.user, users.first_name, users.last_name, tweets.tweet, tweets.date_tweet FROM users INNER JOIN tweets ON users.use"
url: "https://hashnode.com/posts/introduction-to-golang-build-a-mini-twitter-clone/62bd0596a5678c068452dbaf/comment/62bd16e9de0d0a065f4f6f1c"
---

[Discussion](https://hashnode.com/posts/introduction-to-golang-build-a-mini-twitter-clone/62bd0596a5678c068452dbaf)

Comment [Introduction to Golang: build a mini Twitter clone](https://hashnode.com/posts/introduction-to-golang-build-a-mini-twitter-clone/62bd0596a5678c068452dbaf)

[Nicolás Parada](https://hashnode.com/@nicolasparada)

[Jun 30, 2022](https://hashnode.com/posts/introduction-to-golang-build-a-mini-twitter-clone/62bd0596a5678c068452dbaf/comment/62bd16e9de0d0a065f4f6f1c)

```
dbQuery := "SELECT users.user_id, users.user, users.first_name, users.last_name, tweets.tweet, tweets.date_tweet FROM users INNER JOIN tweets ON users.user_id = tweets.user_id INNER JOIN followers ON users.user_id = followers.id_user WHERE followers.id_follower = ? ORDER BY tweets.date_tweet DESC;"
rows, err := database.DB.Query(dbQuery, c.Params("id"))
```

You can avoid SQL injection by this simple change. Use a placeholder (`?`) for the argument in the query and pass the argument in the `db.Query` method.

[Bogdan N.](https://hashnode.com/@bog)

[Jun 30, 2022](https://hashnode.com/posts/introduction-to-golang-build-a-mini-twitter-clone/62bd0596a5678c068452dbaf/comment/62bd16e9de0d0a065f4f6f1c#reply-62bdac8e79c4ef14aeaacf05)

Definitely!

Yeah I wanted to approach the project as someone who didn't know much about SQL and show the errors as well. However I might edit it a bit just in case people end up copying it anyway.

Thanks!
