unable to insert into mysql table
hi
im unable to insert a record into the table but im able to execute the select
query..i checked ,the db connection is true..
Code:
if(db1.open())
{
qDebug()<<"connection ok";
query.exec("insert into waitrequest(bednumber)values('123')");
}
but it shows message like below...
QSqlQuery:: exec: database not open
but if i use select query i get the result!!.
any help is highly respected!!
thanks...:confused::crying:
Re: unable to insert into mysql table
I think that the line should read
query.exec("insert into waitrequest(bednumber)" "values('123')");
Re: unable to insert into mysql table
In line
You are getting database connection named "ganesh". And in line
You are using default database connection. Change this line to :
Re: unable to insert into mysql table
hi lesiok
thanks for ur help ,i ll try wat u said ,and come back
thanks...
unable to insert problem (fixed)
Hi Lesiok
thanks for ur help,it worked correctly,i was trying this for 3 hrs....
thanks a lot...
:D:D