• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

2 zapytania sql

lolek111

New Member
Joined
Feb 4, 2009
Messages
41
Reaction score
0
Elo. Potrzebuje 2 zapytan sql 1 zeby wszystkim zmienilo w bazie kodowanie na md5 a 2 zeby wszystkim dodalo 2 dni pacca
 
Przeciez to pierwsze napisalem Ci wczoraj,a to drugie mozesz zrobic na podstawie pierwszego.
Tylko jak czesc ma md5, czesc ma plain to bedziesz mial problem.
 
Code:
UPDATE `accounts` SET `password` = md5(`password`);
UPDATE `accounts` SET `premdays` = `premdays` + 2;
 
tfs sam hashuje jak sie skuma ze zmieniles z plain na md5 w configu z tego co pamiętam, przez co mialem troche kiche, bo najpierw zahashowalem passy a potem zmienilem :D
 
@zakius:
Code:
					if(db->getDatabaseEngine() != DATABASE_ENGINE_MYSQL && db->getDatabaseEngine() != DATABASE_ENGINE_POSTGRESQL)
					{
						if(DBResult* result = db->storeQuery("SELECT `id`, `password`, `key` FROM `accounts`;"))
						{
							do
							{
								query << "UPDATE `accounts` SET `password` = " << db->escapeString(transformToMD5(result->getDataString("password"), false)) << ", `key` = " << db->escapeString(transformToMD5(result->getDataString("key"), false)) << " WHERE `id` = " << result->getDataInt("id") << ";";
								db->executeQuery(query.str());
							}
							while(result->next());
							result->free();
						}
					}
					else
						db->executeQuery("UPDATE `accounts` SET `password` = MD5(`password`), `key` = MD5(`key`);");

Chyba jo ;d
 
Back
Top