>That should be
>
> sql_create_3(table,
> 1, 3,
> unsigned int, id,
> string, name,
> string, info);
>
>The critical change is the additional commas.
Sorry, it was fault, I forgot the commas. I don't know wheather it would
compile without commas.
>I don't know that MySQL++ will not work with class CString, but I have no
>evidence to believe that it will work, either. Use standard C++ strings if
>at all possible.
I've tried with CString, standard C++ strings and i am always obtaining the
same result. Note that the problem is the "INSERT INTO " constant string in
the SQLQuery's method "insert", the rest of the sentence works fine.
template <class T> SQLQuery& insert(const T &v) {
reset();
*this << "INSERT INTO " << v.table() << " (" << v.field_list()
<< ") VALUES (" << v.value_list() << ")";
return *this;
}
The problem is that the result should be:
"INSERT INTO table VALUES(id,name,info) VALUES (1,'Item1','Description1')"
But I obtain:
"0045A884table VALUES(id,name,info) VALUES (1,'Item1','Description1')"
I suppose the 0045A884 is the result of considering the constant string
"INSERT INTO " as a void *, because, when I trace the code, the _Myt&
ostream::operator<<(const void *_Val) is called. Any idea?
When doing:
Query query;
query << "INSERT INTO";
It works, but it doesn't when doing:
SQLQuery query;
query << "INSERT INTO";