|
I tried to use this class with mysql 5.0 but it don't work
Can anybody help me !!
Thanks!!!!
|
|
|
|
|
Actually, I been using it for a while with 5.0 and it works great.
Make sure you change the path in the project settings for the lib and include files. Also, make sure you update all the Lib files if you copy them to you local project dir.
|
|
|
|
|
Rolando
|
|
|
|
|
If you got compile errors like:
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_close@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_select_db@8
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_connect@16
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_init@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_free_result@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_query@8
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_store_result@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_insert_id@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_fetch_field@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_ping@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_num_rows@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_fetch_row@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_num_fields@4
mysqlplus.obj : error LNK2001: unresolved external symbol _mysql_fetch_field_direct@8
Then here is the solution: press alt+f7, goto the link tab and add this: "libmysql.lib " (without the "") in the Object/Library Modules
Where to put the files !!!!....
Cant you write a REALLY newbie toturial....
In your VC98/ folder
I am getting the following error using VC++6. I am just learning VC++/MySQL so it may be a "pilot error"
Compiling...
mysqlplus.cpp
C:\MySQL C++ Wrapper\mysqlplus.cpp(117) : error C2065: 'mysql_connect' : undeclared identifier
Error executing cl.exe.
mysqlplus.exe - 1 error(s), 0 warning(s)
Thank You in Advance
Just add the libraries to you c++ folder, dont use the new ones use these:
http://tangentsoft.net/mysql++/releases/mysql++-1.7.1-win32-vc++.zip
Hi ,
please help me, how can i fix this ?!
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(397) : error C4716: 'sql_var_c::operator=' : must return a value
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(406) : error C4716: 'sql_var_c::operator=' : must return a value
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(415) : error C4716: 'sql_var_c::operator=' : must return a value
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(421) : error C4716: 'sql_var_c::operator=' : must return a value
Someone already faced this problem
Return a value in the sql_vac_c::operator: like on the end:
return 0; //(if you dont want it to loop, but im not really 100% sure about this)
~NightGhost
|
|
|
|
|
I'm new to VC++ environment. I have installed Mysql server version 4.1 in my machine. I tried to compile and run your example program. When I compile the VC++ compiler shows the following linker error , even though I have included the "Mysql include folder" in include section and "Mysql lib (mysqlclient.lib)" in library section.
Linking...
ex01.obj : error LNK2001: unresolved external symbol "public: char * __thiscall sql_field_c::get_name(void)" (?get_name@sql_field_c@@QAEPADXZ)
ex01.obj : error LNK2001: unresolved external symbol "public: class sql_field_c __thiscall sql_result_c::fetch_field(unsigned int)" (?fetch_field@sql_result_c@@QAE?AVsql_field_c@@I@Z)
ex01.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall sql_result_c::n_fields(void)" (?n_fields@sql_result_c@@QAEIXZ)
ex01.obj : error LNK2001: unresolved external symbol "public: class sql_result_c * __thiscall sql_query_c::store(void)" (?store@sql_query_c@@QAEPAVsql_result_c@@XZ)
ex01.obj : error LNK2001: unresolved external symbol "public: __thiscall sql_connection_c::~sql_connection_c(void)" (??1sql_connection_c@@QAE@XZ)
ex01.obj : error LNK2001: unresolved external symbol "public: __thiscall sql_query_c::~sql_query_c(void)" (??1sql_query_c@@QAE@XZ)
ex01.obj : error LNK2001: unresolved external symbol "public: int __thiscall sql_query_c::execute(char *)" (?execute@sql_query_c@@QAEHPAD@Z)
ex01.obj : error LNK2001: unresolved external symbol "public: __thiscall sql_query_c::sql_query_c(class sql_connection_c *)" (??0sql_query_c@@QAE@PAVsql_connection_c@@@Z)
ex01.obj : error LNK2001: unresolved external symbol "public: __thiscall sql_connection_c::sql_connection_c(char *,char *,char *,char *)" (??0sql_connection_c@@QAE@PAD000@Z)
LIBCMTD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/MysqlTest.exe : fatal error LNK1120: 10 unresolved externals
Error executing link.exe.
Can you please give me the solution for this problem.
AT Karthikeyan
|
|
|
|
|
you need to link libmysql.lib
|
|
|
|
|
Hi all,
I'm looking for a way to execute simple queries (BCB6.0 <-> MySQL 4.1.18) and this wrapper looks great. I'm having problems getting things to work properly, though.
(Unresolved external 'mysql_close' / 'mysql_init' / 'mysql_real_connect' ...)
Is anyone here using Borland and the C++ Wrapper?
PLEASE contact me at magnus.winsth@bredband.net, ICQ 12715455 or at this forum of course.
All I want is to get a very very simple example to work...
A bunch of thanx in advance!!
/ Magnus Winsth
-----------------------------------------------
Fly safe and keep the dirty side down!
|
|
|
|
|
Where to put the files !!!!....
Cant you write a REALLY newbie toturial....
|
|
|
|
|
I am getting the following error using VC++6. I am just learning VC++/MySQL so it may be a "pilot error"
Compiling...
mysqlplus.cpp
C:\MySQL C++ Wrapper\mysqlplus.cpp(117) : error C2065: 'mysql_connect' : undeclared identifier
Error executing cl.exe.
mysqlplus.exe - 1 error(s), 0 warning(s)
Thank You in Advance
alan
|
|
|
|
|
I've got the same error. Please, could anyone help us with this error
|
|
|
|
|
please use mysql_real_connect instead of mysql_connecgt
|
|
|
|
|
Just replace 'mysql_connect' with 'mysql_real_connect()' with proper parameters.
|
|
|
|
|
How do you use this class to add binary data?
I find this class quite good - although I agree explanation is a bit short. However better this than nothing.
|
|
|
|
|
i changed the mysql_connect to mysql_real_connect and copyied the libmysql.dll to the same folder and also libmysql.lib to the project settings.
i have a mysql 4.1.18 server running, using headers/librarys from mysql++ 1.7.1 and using vc++6
below is my code, but i get "oops... didn't execute!!" as an output to the screen everytime. the login details and database name are correct. is it that my server isnt compatible with this or ??????
sql_connection_c connection( "test1", "localhost", "root", "abc");
sql_query_c query( &connection );
sql_result_c *sql_result = 0;
if ( !query.execute( "select * from login" ) )
{
printf( "oops... didn't execute!!\n" );
return;
}
|
|
|
|
|
Hi ,
please help me, how can i fix this ?!
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(397) : error C4716: 'sql_var_c::operator=' : must return a value
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(406) : error C4716: 'sql_var_c::operator=' : must return a value
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(415) : error C4716: 'sql_var_c::operator=' : must return a value
c:\documents and settings\ka$h\desktop\study\mysqlwrap_src\mysqlplus.cpp(421) : error C4716: 'sql_var_c::operator=' : must return a value
Someone already faced this problem
|
|
|
|
|
Ok now i fixed that , now its giving all wierd linking errors
mysqlplus.obj : error LNK2019: unresolved external symbol _mysql_query@8 referenced in function "public: int __thiscall sql_query_c::try_execute(char *)" (?try_execute@sql_query_c@@QAEHPAD@Z)
mysqlplus.obj : error LNK2019: unresolved external symbol _mysql_store_result@4 referenced in function "public: int __thiscall sql_query_c::execute(char *)" (?execute@sql_query_c@@QAEHPAD@Z)
mysqlplus.obj : error LNK2019: unresolved external symbol _mysql_insert_id@4 referenced in function "public: __int64 __thiscall sql_query_c::insert_id(void)" (?insert_id@sql_query_c@@QAE_JXZ)
mysqlplus.obj : error LNK2019: unresolved external symbol _mysql_fetch_field@4 referenced in function "public: struct st_mysql_field * __thiscall sql_query_c::fetch_field(void)" (?fetch_field@sql_query_c@@QAEPAUst_mysql_field@@XZ)
mysqlplus.obj : error LNK2019: unresolved external symbol _mysql_ping@4 referenced in function "public: int __thiscall sql_query_c::ping(void)" (?ping@sql_query_c@@QAEHXZ)
mysqlplus.obj : error LNK2019: unresolved external symbol _mysql_num_rows@4 referenced in function "public: __int64 __thiscall sql_result_c::n_rows(void)" (?n_rows@sql_result_c@@QAE_JXZ)
mysqlplus.obj : error LNK2019: unresolved external symbol _mysql_fetch_row@4 referenced in function "public: class sql_row_c __thiscall sql_result_c::fetch_row(void)" (?fetch_row@sql_result_c@@QAE?AVsql_row_c@@XZ)
|
|
|
|
|
ft
u must link to libmysql.lib
then
see compiling on newer MySQL 4.1.x
it's all!
|
|
|
|
|
Hi,
I had a problem compiling this on MySQL 4.1.7.
Defining USE_OLD_FUNCTIONS will overcome the compile issues, but it still has linking problems [mysql_connect]
FYI, for anybody having this problem, changing the old mysql_connect to the new mysql_real_connect will solve this problem.
Change line in OPENDB *sql_connection_c::grabdb()
[line 117] if ( !mysql_connect( &odb->mysql, host, user, password ) )
To
if ( !mysql_real_connect( &odb->mysql, host, user, password, database, 0, NULL, 0 ) )
This should work fine [works for me!]
HTH
Mark
Windows, Linux and Internet Development Consultant
http://www.scriptsmiths.co.za
|
|
|
|
|
hello...now i am having problems with inserting data...can anybody tell me the correct syntax dor doing this ?
sql_connection_c connection( "database", <br />
"localhost", "username", "password" );<br />
<br />
sql_query_c query( &connection );<br />
<br />
sql_result_c *sql_result = 0;<br />
<br />
<br />
<br />
if ( !query.execute("insert into debx_admins (id,username,password,email) values (1,'kaney07','whatever','me@myself.com')"))<br />
{<br />
printf( "oops... didn't execute1!!\n" );<br />
return;<br />
}
returns " oops didn't execute..."
Thanks for ur replies in advance ...
Best Regards,
kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
hi
this class works fine when i connect to the localhost but fails when i give an IP as a hostname....Any suggestions ? I am sure that the username/pass etc is correct but it gives " ooops didn't execute" but it does work without a problem..
kane
http://www.coderkane.com
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
sorry the problem was not with the program but with the acess control settinhgs on the server...it worked after i allowed mysql access to anybody with correct id/password
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
Compiling...
mysqlplus.cpp
g:\realmsmud\mysqlplus.cpp(396) : error C4716: 'sql_var_c::operator=' : must return a value
g:\realmsmud\mysqlplus.cpp(404) : error C4716: 'sql_var_c::operator=' : must return a value
g:\realmsmud\mysqlplus.cpp(412) : error C4716: 'sql_var_c::operator=' : must return a value
g:\realmsmud\mysqlplus.cpp(417) : error C4716: 'sql_var_c::operator=' : must return a value
Guess it wasn't written initially using Visual Studio 7.1.
|
|
|
|
|
I can't figure out how to do it with your code. Can you or someone else please enlighten me? Thanks!
|
|
|
|
|
is there a way i can get all the names, of the database that are in MySql DataBase . for example a function that return all the DataBase Name found in MySql DataBase.
Thank You,
jen0s
|
|
|
|
|
MySQL has a "SHOW DATABASES" syntax, the result set is the name of every visible to the current user on the current server.
e.g.
mysql> show databases;
+------------------------+
| Database |
+------------------------+
| db1 |
| phpbb |
| xcart |
...
Windows, Linux and Internet Development Consultant
http://www.scriptsmiths.co.za
|
|
|
|