Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

Why do we use --+ to comment on the rest of the query?

Asked by Anil Jha Jan 12, 2022 1.0K views 2 answers
Share

About this question

Why should we sometimes use --+ instead of -- in SQL injection to comment the rest of the query? 

I have encountered some websites where when I used -- + to comment on the rest of the query it didn't work, but when I tried --+ it worked.

In the MySQL official documentation there is no such thing as --+ and we only have -- and two other ways.

Why does this happen? I want to know exactly why this works sometimes and -- doesn't, and why there is no --+ for comments in the MySQL man page? 

Your answer

2 Answers

Mike Plau Latest answer

Answered on Oct 14, 2025

There is no such thing as --+ in the official MySQL manual. We only have -- and two additional ways. 

Stickman Hook

Was this helpful?

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.