Click here to Skip to main content
15,901,505 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir..

i created the coding as per the code project friends suggestions.

i face the problem..

error is.

"two pointers can't be added"


my coding is :


Con->Execute("INSERT INTO t2 VALUES(" + iData+ ")",RecordsAffected,1);


Con is the connection object for my MySQL database.

iData is they variable that get the integer value from the user ...
Posted
Updated 25-Jul-11 2:47am
v2

1 solution

Try this:
C
char buf[10];
itoa(iData, buf, 10);
Con->Execute("INSERT INTO t2 VALUES(" + buf + ")",RecordsAffected,1);

NOTE: include <stdlib.h> at the top of your code.
 
Share this answer
 
v2
Comments
@BangIndia 25-Jul-11 8:45am    
same error . sir.. what i want to do now
[no name] 25-Jul-11 9:07am    
I have updated my answer, try it.
@BangIndia 25-Jul-11 9:23am    
sir.. still the same prob..

two pointer can't be added..
Stephen Wiria 25-Jul-11 9:17am    
Shameel, are you sure placing " (without escaping it) inside the SQL statement won't produce error?
@BangIndia 25-Jul-11 9:23am    
no i don't know about that..
i want to insert the data dynamically to the database..
please tell what i want to do.

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