String sql = "SELECT (Employee_name, Password) FROM employee WHERE (Employee_name = '"+name+"' AND Password = '"+password+"')";
and getting the following exception in JSP java.sql.sqlexception insert operand should contain 1 column(s)
Please help.
Correct way is
String sql = "SELECT Employee_name, Password FROM employee WHERE Employee_name = '"+name+"' AND Password = '"+password+"'";
You can keep ()
for where clause but not in select list.
This is what happens in your case
mysql> select (firstname,email) from users limit 1 ;
ERROR 1241 (21000): Operand should contain 1 column(s)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With