|
Author: nas
Date: 19-08-02 11:20
I am a new programmer on C++/mysql . That was the first example that worked whithout warnings on compiling ! . The only problem was the server host ( #define HOST "localhost " // so, where's your mysql server? ) . It dind't worked like that so I put the IP to that space !! . Special thanks to that page ,
|
|
Reply To This Message
|
|
Author: Dan Langille
Date: 19-08-02 15:33
If localhost didn't work for you, then I image your DNS isn't working or your mysql server isn't accepting local connections, or it's not actually localhost and it's on another machine.
|
|
Reply To This Message
|
|
Author: Jason
Date: 28-07-04 21:55
For some reason I had to append (ostream&) to the front of the query assignment.
I was getting the following error
create_table.cpp:28: error: ISO C++ says that `std::basic_ostream<char,
_Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)
[with _Traits = std::char_traits<char>]' and `SQLQuery&
operator<<(SQLQuery&, const mysql_ColData<std::string>&)' are ambiguous even
though the worst conversion for the former is better than the worst
conversion for the latter
Looking over some code from mysql.com simple1.cc showed the query string formed like this:
(ostream&)query << "select * from stock";
I applied that to create_table.cpp and it compiled without a hitch.
Freebsd 5.2.1 / gcc 3.3.3
If anyone else has this problem hope it helps.
|
|
Reply To This Message
|
|