hi,
in sqlite3 u r having a function named callback whose third argument is used
to save the
value of a column. u can store that value in an array or in char vairiable
also.
try this
regards
Nishit
On 9/5/07, "Severin Müller" <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I'm new to sqlite3, and i' have some Problems with my code. I'm trying to
> select data from a table and to save the result in a string. but i have no
> clue how to accomplish this.
>
> Here is a part of my code:
>
> std::string get_user_info(const char* nick,int mode)
> {
> #ifdef _WIN32
> const char *filename = "db\\users.db";
> #else
> const char *filename = "db/users.db";
> #endif
> services serv;
> Config conf;
> sqlite3 *db;
> char *zErrMsg = 0;
> int rc;
> char *sql = (char*) malloc(sizeof(char)*64);
> rc = sqlite3_open(filename,&db);
> if(rc)
> {
> std::cout << "S_ERR_USERDATABASE" << std::endl;
> globops(conf.get_s_name(),S_MSG_SRVGOINGDOWN);
> sqlite3_close(db);
> return NULL;
> }
> sprintf(sql,"SELECT * FROM '%s';",nick);
> if(rc!=SQLITE_OK)
> {
> fprintf(stderr,"SQL error: %s\n",zErrMsg);
> sqlite3_free(zErrMsg);
> }
> user = ...// i'd like to store the db data in a string here...
> return user;
> }
>
> Can anybody help me here? Thanks
>
>
> Regards
>
> Sevi
>
>
> --
> GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
> Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
>
>
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
>
> -----------------------------------------------------------------------------
>
>