Cyrebo
28th March 2013, 18:10
Hi, I'm working on a program where I get user input and insert that value to my database. At the moment, I'm getting the following error:
QSqlError(-1, "Unable to fetch row", "No query") But I know thats its not my coding because when I try a select statement, it works fine with no problems. My INSERT INTO statement is as follows:
str = pLineEdit->text();
QString qry = QString("INSERT INTO customer (name, phone_no, address, city) VALUES ('%%1%', NULL, NULL, NULL").arg(str);
Is my INSERT statement correct?
QSqlError(-1, "Unable to fetch row", "No query") But I know thats its not my coding because when I try a select statement, it works fine with no problems. My INSERT INTO statement is as follows:
str = pLineEdit->text();
QString qry = QString("INSERT INTO customer (name, phone_no, address, city) VALUES ('%%1%', NULL, NULL, NULL").arg(str);
Is my INSERT statement correct?