Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String fname = request.getParameter("username");
- String mail = request.getParameter("email");
- String country = request.getParameter("country");
- String pword = request.getParameter("password");
- Class.forName("com.mysql.jdbc.Driver");
- Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/foodforthought", "root",
- "ajay143enexl");
- Statement statement = connection.createStatement();
- try {
- int i = statement.executeUpdate("insert into users (username,email,country,password) values ("+fname+"','"+mail+"','"+country+"','"+pword+")");
- out.println("Successfully registered");
- } catch (Exception e) {
- out.println(e);
- e.printStackTrace();
- }
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'India',')' at line 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement