I have a two table called student and book. student table having 3 column studentid,name,coursename; book table having 4 column student id,name ,coursename,bookname,
I am trying to create a query that will get student id from book table and comapare with student table and if id match with that table the value will get printed but I am getting an error "java.sql.SQLSyntaxErrorException: Unknown column '1' in 'where clause'"
String abc=txt1.getText();
String sql;
sql = "select * from `student` where studentid = `"+abc+"`";
Can anyone see what I am doing wrong here?