Closed LinArcX closed 6 years ago
Hi
The object db is an instance of Nut::Database-Delivered class. Checkout tests dir for more samples please. https://github.com/HamedMasafi/Nut/blob/master/test/common/weblogdatabase.h
Let me know if you have any other problem
BR
Hi
The object db is an instance of Nut::Database-Delivered class. Checkout tests dir for more samples please. https://github.com/HamedMasafi/Nut/blob/master/test/common/weblogdatabase.h
Let me know if you have any other problem
BR
I have a look on weblogdatabase.h and weblogdtabase.cpp, but sitll confused . example i want to connect to a mysql database : source is 192.168.2.1:8987 username: jefftiger password:12345. how can i to do for connecting it? best regards, jeff
Just like QSqlDatabase
we normal use QSqlDatabase as below codes: QSqlDatabase dbx = QSqlDatabase::addDatabase("QMYSQL","xgmm"); dbx.setHostName("db-dskvg072.sql.otto.com"); dbx.setPort(62795); dbx.setDatabaseName("test"); dbx.setUserName(LUserName); dbx.setPassword(LUserPW);
but i don't know how to use it in weblogdatabase.h cloud you give me a simple code? best regards, jeff
WeblogDatabase dbx;
dbx.setDriver("QMYSQL");
dbx.setHostName("db-dskvg072.sql.otto.com");
dbx.setPort(62795);
dbx.setDatabaseName("test");
dbx.setUserName(LUserName);
dbx.setPassword(LUserPW);
hi Many thanks for your explain. i will have a try. best regards, jeff
WeblogDatabase dbx; dbx.setDriver("QMYSQL"); dbx.setHostName("db-dskvg072.sql.otto.com"); dbx.setPort(62795); dbx.setDatabaseName("test"); dbx.setUserName(LUserName); dbx.setPassword(LUserPW); qDebug()<<dbx.open();
hi HamedMasafi I have a try. the error is still QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 Could not connect to database, error = Driver not loaded Driver not loaded false Anything is wrong in my code? Nut seems need mysql driver still and not is a depend third part drivers?
Hi. and thank you for this greate job. i want to use nut in my app but i;m a bit confused about docs. see:
Read data from database:
where db defined? or in update sample:
The Post Object comes from where?! and how db knows that it has a posts() method?