- CDatabase::CDatabase( char* server , char* username, char* password, char* database, unsigned int port , MYSQL* mysql)
PurpleYouko wrote:Why exactly are you editing the code in Database.cpp?
You seriously should NOT be messing with that unless you are a bit of an expert.
Even I don't ever mess with those core files like database control stuff if i can help it. One wrong bit of code and the entire server is dead, possibly irretrievably so.
You just overwrote all the original values that were being copied into the CDatabase object.
Those values need to be passed into the new database object via the list of objects included in the function call
Note char* server is a char array (kind of a string but more primitive) and NOT the word localhost which means absolutely nothing to the C++ compiler. If you had written it as "127.0.0.1" (including the speech marks) it might just have worked but I kind of doubt it. The code is expecting a char array rather than a string so chances are it would just die.
Same for Username, Password and Database.
Strangely, the Port value 3306 will most like actually work in the way that you coded it. The others though, They aren't even going to let you compile in the present format (thankfully) If it did compile like this your server would like be completely ruined until you put it all back the way it was.
The CDatabase constructor needs to take inputs so that all these values remain variable. The are initially read in from the .conf files in your server binary folder. That's where you edit your database info. NOT in a highly sensitive bit of core code.
My best advice here is to undo all the changes that you made in this file and then recompile the server. And i mean ALL. If you leave any change at all in there, however tiny, chances are your code base is screwed forever. Might be best to just download the server source and start over.
just remember all your editing should be in the CONF files, not the code.
Aww ~ sorry I know I was wrong...i undo all I have encode already sir PY...my bad thank for the advice PY it helps a lot..now my problem is this CMS thing I can't login into the server this error show.
I posted this in "New CMS" threads/Post but I got no reply I was wondering if you could help me on this? Thank you PY...