Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!
0 Пользователей и 1 Гость просматривают эту тему.
QSqlQuery q; q.prepare("INSERT INTO companies (name, director, phone, fax, type_own, area, count_staff, email, url, desc)" "VALUES(:name, :director, :phone, :fax, :type_own, :area, :count_staff, :email, :url, :desc)"); q.bindValue(":name", ui->name->text()); q.bindValue(":director", ui->director->text()); q.bindValue(":phone", ui->phone->text()); q.bindValue(":fax", ui->fax->text()); q.bindValue(":type_own", ui->typeOwn->currentText()); q.bindValue(":area", ui->area->text()); q.bindValue(":count_staff",ui->countStaff->text()); q.bindValue(":email", ui->email->text()); q.bindValue(":url", ui->url->text()); q.bindValue(":desc", ui->desc->toPlainText()); if(q.exec()) { msgBox.setText("запись успешно добавлена"); msgBox.exec(); } else { errText += q.lastError().text(); msgBox.setText("ошибка при добавлении\n" + errText + "\n"); msgBox.exec(); }
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc)VALUES(:name, :director, :phone, :fax, :type_own, :area, :count_staff, :ema' at line 1 QMYSQL: Unable to execute query
1.Слово desc (DESC) - зарезервировано в SQL.
Страница сгенерирована за 0.016 секунд. Запросов: 22.