locus
13th March 2007, 14:30
I have linked my QSqlQuerry model to a view that is supposed to display the result of the following querry
model->setQuery("SELECT * FROM user_info WHERE user_fname = 'lineEdit->text()' ");
I am trying to implement a simple search where a user enters a name (in lineEdit) and gets the record corresponding to that name.
the code i have there does not work,as i think lineEdit->text() is being seen as a literal, and thats waht the querry searches for, instead of what the user entered(the lineEdit's value).
How do i get the value of the lineEdit into the querry for it to give me the results i want.
Thanks for your attention.
model->setQuery("SELECT * FROM user_info WHERE user_fname = 'lineEdit->text()' ");
I am trying to implement a simple search where a user enters a name (in lineEdit) and gets the record corresponding to that name.
the code i have there does not work,as i think lineEdit->text() is being seen as a literal, and thats waht the querry searches for, instead of what the user entered(the lineEdit's value).
How do i get the value of the lineEdit into the querry for it to give me the results i want.
Thanks for your attention.