Beginer - plz need help!
Posted by: sazzad hossain
Date: November 23, 2010 01:46PM

hii

I have tried following code to store data in to mysql from C program. When I compiled it does no0t show any error but it does not store in mysql;

#include <my_global.h>
#include <mysql.h>

int main(int argc, char **argv)
{


char buffer [50];
int a=100;
int b=50;
int c=10;
int i=99;
MYSQL *conn;

conn = mysql_init(NULL);
mysql_real_connect(conn, "localhost", "root", "000", "sazz", 0, NULL, CLIENT_MULTI_RESULTS);

mysql_query(conn,"INSERT INTO writers VALUES (%i)");

sprintf (buffer,"insert into writers values(%d,%d,%d);", a, b, c);


mysql_close(conn);

}

thnaks in advance

Options: ReplyQuote


Subject
Views
Written By
Posted
Beginer - plz need help!
828
November 23, 2010 01:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.