MySql Select statement
I'm new to QT and have trouble with my first application. I set up a mysql database connection which works perfectly fine for statements like "Update" and "Insert" but not for "Select".
I want to check whether a specific data is already existing in my database:
qry1.prepare("SELECT * FROM boardgame WHERE name='testspiel5'");
int counter = 0;
I've also tried to use @if(qry1.first())@
My counter is always zero but testspiel5 exists in my db. If I run the statement above directly in phpmyadmin it shows 1 row as expected. But not in my program.
you need to run qry1.exec() first before you can read data from the query object
Thank you chrho, that solved my issue!