I have been coding a GUI program as a MySQL database manager/utility...
The idea of the section I am focusing on is, your enter a guild's name, and it queries the database and displays the guild's info in a textbox. As a test I have used this query:
SELECT * FROM `guilds` WHERE `tag` = 'ARD'
It successfully queries the database for the guild I am testing on, and displays this in my textbox:
TAG,description,created,ranks,bank
(Those are the value from my database)
I am trying to store each value (description, TAG, so on..) to a separate char/string. I have tried using the getline and that just stores them all (on different lines) to a single char.
std::string a;
std::string b;
std::string c;
(above declared at the top)
a = string(newdelim)+string(row[i]);
stringstream stream(a);
while(getline(stream, c, ','))
{
b = c+"\n";
}
(then goes on to write d to the texbox)
The value char "newdelim" is the delimiter, and the char "row" is the mysql row, both written into the void function.
This is the code I tried using for testing getline().
I have searched over google, the forums, and asked a few buddies on MSN, but alas, no answer to my question:
How do I use a delimiter to seperate a char/string into separate values?
Overview:
I need to split a string or char with a delimiter and store each value to a new char.
I have tried getline, and that just stores them on the same char.
Help? :)
(Sorry if I made this unclear/repeated things too much, I haven't... I haven't really slept.)