Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool addDirectors(const Movie &theMovie)
- {
- QStringListIterator it(theMovie.directors_);
- while(it.hasNext())
- {
- QSqlQuery query("SELECT NAME FROM DIRECTOR WHERE NAME = :name;");
- query.bindValue(":name", it.);
- if(query.isNull())
- {
- query("INSERT INTO DIRECTOR(NAME) VALUES (:name);");
- query.bindValue(":name", *it);
- }
- query("INSERT INTO DIRECT(ID, NAME, USERNAME) VALUES (:id, :name, :username);");
- query.bindValue(":id", theMovie.id_);
- query.bindValue(":name", *it);
- query.bindValue(":username", theMovie.username_);
- query.clear();
- }
- }
Add Comment
Please, Sign In to add comment