• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

correct syntax

 
kelly devon
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, please i need help in getting the correct syntax for a select statement that uses where and . what i mean is this; ("SELECT data FROM register WHERE date="+"'"+21+"'"+ AND+ "'"+22+"'"); i cant seem to get it right thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you not using a PreparedStatement? You are risking SQL injection by creating statements as you are.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic