yebirtiebal
10-21-2007, 12:51 PM
Hi,
I working in my project which I am using Java with mysql. While I am running my program I got the error.
Unknown column 'XXXX' in 'field list'
where xxxx is attribute value.
Here is the fragment of code where the error occures. Please help me.
String fn, ln, phone, address;
System.out.println("Enter Customer Detail...");
System.out.println("========================");
//System.out.println("Enter Customer ID...");
//cID=in.nextInt();
System.out.println("Enter Customer First Name...");
fn=in.next();
System.out.println("Enter Customer Last Name...");
ln=in.next();
System.out.println("Enter Customer phone...");
phone=in.next();
System.out.println("Enter Customer address...");
address=in.next();
//write to customer table
String s1="insert into customer( FName, LName, phone, address) values("+fn+", "+ln+", "+phone+", "+address+")";
I working in my project which I am using Java with mysql. While I am running my program I got the error.
Unknown column 'XXXX' in 'field list'
where xxxx is attribute value.
Here is the fragment of code where the error occures. Please help me.
String fn, ln, phone, address;
System.out.println("Enter Customer Detail...");
System.out.println("========================");
//System.out.println("Enter Customer ID...");
//cID=in.nextInt();
System.out.println("Enter Customer First Name...");
fn=in.next();
System.out.println("Enter Customer Last Name...");
ln=in.next();
System.out.println("Enter Customer phone...");
phone=in.next();
System.out.println("Enter Customer address...");
address=in.next();
//write to customer table
String s1="insert into customer( FName, LName, phone, address) values("+fn+", "+ln+", "+phone+", "+address+")";