Hello I have tried every forum and resource i have and can still not find the answer to my question.
I am making a booking management system. One of the features is the admin can search someones email and get their details from the database. So i put a line edit so i can get the QString from the email and then i tried to parse it into a SQL query. Thought this would be easy but QT said no. so i am at a complete loss.
Any help will be much appreciated.
The code:
QString email = ui->lineEdit_custsearch->text();
QSqlQuery qry;
QString dets = "SELECT firstname FROM customer WHERE email=="+email+"";
if (qry.exec(dets))
{
for (int i = 0;qry.next();i++)
{
ui->lineEdit_first->setText(qry.value(0).toString());
}
}