i have problum in finding data from mysql database & show data in listwidget with query given below
QSqlQuery query2("SELECT title * from mediadetails where title LIKE '%:title%' ");
i want to find data that containing specific character that mainsioned in LIKE within query
problum comes when i add items within listWidget
code is
void VistaMedia::content()
{
QString LEdit1=searchLineEdit->text();
QSqlQuery query2("SELECT title * from mediadetails where title LIKE '%:title%' ");
query2.bindValue(":title",LEdit1);
query2.exec();
while(query2.next());
{
listWidget->addItem(query2.value(0).toString());
QMessageBox::information(this,"Error","File not found");
}
}
thanks in advance
Bookmarks