QSqlQuery qry
("SELECT time,value FROM customer");
while(qry.next())
{
int at=qry.at();
qDebug()<<"we are at"<<qry.at();
for(int i=0;i<at;i++)
{
qDebug()<<"xvalue"<<_x[i];
_x[i]=qry.value(0).toDouble();
_y[i]=qry.value(1).toDouble();
}
}
QSqlQuery qry("SELECT time,value FROM customer");
while(qry.next())
{
int at=qry.at();
qDebug()<<"we are at"<<qry.at();
for(int i=0;i<at;i++)
{
qDebug()<<"xvalue"<<_x[i];
_x[i]=qry.value(0).toDouble();
_y[i]=qry.value(1).toDouble();
}
}
To copy to clipboard, switch view to plain text mode
here I am trying to access the data in array x and y i.e. all the value in these array but the problem is I am getting only the last value in my array i.e. for example my last value is 8 then i am getting all value 8 in my array
I couldn't access all the value in array from database....
please help me
Bookmarks