BUG in MYSQL Plugin

  • Hi everyone,
    I'm tryinig to execute the following SQL query:

    QSqlQuery query;

    query.prepare("INSERT INTO osoby (idosoby, Imie, Nazwisko, DataUrodzenia) "
    "VALUES (?, ?, ?, ?)");
    QString data=this->dataUrodzenia.toString();

    Correct name of table is "osoby" if i type this name in query,this doesnt execute.
    If i type a name of table that doesnt exist query will execute.

    [edit: added missing coding tags @ SGaist]

  • If
    @query.exec(); @

    return false, Check what return:


  • Both queries return no errors.
    "INSERT INTO osoby (idosoby, Imie, Nazwisko, DataUrodzenia) VALUES (?, ?, ?, ?)"

    "INSERT INTO osoby1 (idosoby, Imie, Nazwisko, DataUrodzenia) VALUES (119, 'dsf', 'dsf', 'So sty 1 2000')"

  • I found the solution.I changed the following 2 line commands:
    QSqlQuery query; query.prepare(“INSERT INTO osuob (idosoby, Imie, ########) “ “VALUES (?, ?, ?)”);
    to this one:

    QSqlQuery query(“INSERT INTO osoby (Imie, ########, DataUrodzenia) “ “VALUES (?, ?, ?)”);
    Thanks for help

Log in to reply