
Originally Posted by
ldsjohn
well I think thats what I was looking for, do you know of a good tutorial for doing so
Whole tutorial for one method? 
q.prepare( "INSERT INTO some_table( some_column ) VALUES ( :some_value )" );
q.bindValue( ":some_value", _someValue );
if( q.exec() ) {
// ok
}
else {
// error
}
QSqlQuery q;
q.prepare( "INSERT INTO some_table( some_column ) VALUES ( :some_value )" );
q.bindValue( ":some_value", _someValue );
if( q.exec() ) {
// ok
}
else {
// error
}
To copy to clipboard, switch view to plain text mode
Just watch out for the placeholders --- you'll get interesting results if you forget one bindValue() or make a typo in placeholder name.
Instead of ":name" you can use "?" (in such case you'll have to specify a number as the first argument for bindValue()).
Bookmarks