|
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
|
|
|
|
|
mysqltest error LNK2019: unresolved external symbol _mysql_connect@16 referenced in function "public: struct opendbstruct * __thiscall sql_connection_c::grabdb(void)" (?grabdb@sql_connection_c@@QAEPAUopendbstruct@@XZ)
I got this message when i was trying to compile the code copied from the sample. Can somebody please tell me how to fix it?
|
|
|
|
|
look at mysql manual , " c api part--> mysql_real_connect() " , u can find below message :
"This function is deprecated. It is preferable to use mysql_real_connect() instead. "
, so , u can use mysql_real_connect() ,and
edit some code in mysqlplus.cpp , after u do
this , rebuid , and everthing is ok now !!
|
|
|
|
|
when I retrieve a date variable from my database, I get a 0000-00-00 value from a record where there is a date? any hints
If it's broken, I probably did it
bdiamond
|
|
|
|
|
The other error I submitted was solved by placing the includes where they belonged properly. Now I get the following
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
trymysql.cpp:
Error E2303 c:\Borland\Bcc55\include\mysqlplus.h 81: Type name expected
Error E2139 c:\Borland\Bcc55\include\mysqlplus.h 81: Declaration missing ;
*** 2 errors in Compile ***
The second line below is line 81 of mysqlplus, in class sql_query_c
private:
vector_c <sql_result_c *=""> results;
};
I have no idea as I'm fairly new to C++, so any help is appreciated
Patrick
|
|
|
|
|
Any ideas why I would get the following error:
Error E2209 mysqlplus.h 9: Unable to open include file 'mysql.h'
I have the following in my directory that I’m doing the compile in: my_alloc.h, mysql.h, mysql_com.h, mysql_version.h, mysqlplus.h, and vector.h; along with the sample file shown above with the inputs adjusted to my db.
Patrick
|
|
|
|
|
I'm also new to VC++ environment. I'm not sure about my answer. I think you should add MYSQL server header files(F:\tools\MYSQL 4.1\include) in include path(Tools->Options->Directories->include files) will solve the problem.
Thanks,
Karthikeyan
|
|
|
|
|
I gave you a high mark, because your wrapper class was easy and fast to implement into my own project. Thanks!
There was however one problem, which I solved by setting warnings off and adding following line, to mysqlplus.cpp :
#pragma warning( disable : 4716 ) // Disable warning messages 4716.
Johnny
ps! I know you refer to MySQL homepage for download of interface, but you only need a few files, this you could have in your project, that would make your example even more professional.
|
|
|
|
|
I gave you a high mark, because your wrapper class was easy and fast to implement into my own project. Thanks!
Johnny
|
|
|
|
|
When I compiled your code, I found an error "error C2065: 'mysql_connect' : undeclared identifier". I have already included "mysql.h". How can I get through this. Thank you for your answer.
|
|
|
|