Fixed send information about package and added SQL script installer
This commit is contained in:
@@ -20,19 +20,24 @@ std::string msql_acces::get_passwd(std::string username){
|
||||
}
|
||||
|
||||
std::list<std::string> msql_acces::get_pinfo(){
|
||||
sql::PreparedStatement *pstmt = con->prepareStatement("select * from packages");
|
||||
sql::PreparedStatement *pstmt =
|
||||
con->prepareStatement("select packages.name, packages.created, packages.uses, users.username "
|
||||
"from packages "
|
||||
"join users on users.id=packages.user ");
|
||||
sql::ResultSet *res = pstmt->executeQuery();
|
||||
std::list<std::string> ret;
|
||||
std::string aux;
|
||||
while(res->next()){
|
||||
aux="";
|
||||
aux += res->getString("name");
|
||||
if(res->getBoolean("uses")){
|
||||
aux+=":true";
|
||||
aux += res->getString(1);
|
||||
aux += ":"+res->getString(2);
|
||||
if(res->getBoolean(3)){
|
||||
aux+=":t";
|
||||
}else{
|
||||
aux+=":false";
|
||||
aux+=":f";
|
||||
}
|
||||
aux += ":"+res->getString("created");
|
||||
aux += ":"+res->getString(4);
|
||||
ret.push_back(aux);
|
||||
}
|
||||
delete res;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user