The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 THAT worked !
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
 Re: THAT worked !
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
 Re: THAT worked !
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 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
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 

 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum