Searching a database table for specific information
In this recipe, we will be learning how searching is performed in a database table to fetch the desired information. We assume that a user has forgotten their password. So, you will be prompted to enter the database name, table name, and email address of the user whose password is required. If any user with the email address supplied exists in the database table, then the password of that user will be searched for, accessed, and displayed on the screen.
How to do it…
Follow these steps to find out how data can be searched for in a database table in SQLite:
- Let's create an application based on the
Dialog without Buttons
template. - Add five
QLabel
widgets, fourQLineEdit
widgets, and oneÂQPushButton
widget to the form by dragging and dropping fiveLabel
widgets, fourLine Edit
widgets, and oneÂPush Button
widget on the form. - Set the
text
property of the first threeLabel
widgets toEnter database name
,Enter table name
, andEmail Address
. - Delete...