Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I believe the syntax is wrong on this c++ snippet. Any help appreciated. Thanks

mysql_insert(conn, "INSERT INTO tblURLAccess (IP,Count) VALUES ('192.168.1.1','1'");
Posted

You have a missing ) at the end of the query statement.
mysql_insert(conn, "INSERT INTO tblURLAccess (IP,Count) VALUES ('192.168.1.1','1')");
 
Share this answer
 
v2
Comments
Member 7766180 18-Jul-11 13:56pm    
Doesn't work. The problem is mysql_insert is underlined. Intellsense VS2010 says that it's undefine.
Kim Togo 18-Jul-11 13:59pm    
Then please use "Improve question" and write down what the error is.

But the SQL syntax is still wrong.
Member 7766180 18-Jul-11 14:04pm    
What is the correct syntax?
Member 7766180 18-Jul-11 14:16pm    
Error is....
Error 1 error C3861: 'mysql_insert': identifier not found C:\FB\FBCode Samples\SmallDB\SmallDB\SmallDB.cpp 31 1 SmallDB
Abhinav S 18-Jul-11 14:01pm    
Well in that case this method cannot be found - make sure it exists.
It would not hurt to get into the habit of trying the SQL in the MySQL query browser to test it and eliminate any SQL problems from the situation.
 
Share this answer
 
Comments
Albert Holguin 18-Jul-11 19:31pm    
great suggestion!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900