Commit d8cedf1a authored by Leon Do Castelo's avatar Leon Do Castelo
Browse files

Update autosql.cpp

parent e262dd5d
......@@ -208,19 +208,19 @@ std::vector<QString> Database::getListeReseaux(const QString& name) const
{
QSqlQuery query(db);
query.prepare("SELECT id, nom FROM reseaux WHERE automate = ':nom'");
query.prepare("SELECT id, nom FROM reseaux WHERE automate = :nom");
query.bindValue(":nom", name);
query.exec();
std::cout<<query.lastError().text().toStdString()<<std::endl;
std::vector<QString> names;
if(query.first()) {
names.push_back(query.value("id").toString());
names.push_back(query.value("nom").toString());
}
while(query.next()) {
if(!query.first())
throw "There must be at least one coord in this rule";
do {
names.push_back(query.value("id").toString());
names.push_back(query.value("nom").toString());
}
} while(query.next());
return names;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment