Re: problem to insert data
From: Merrill & Michele (beckjensen_at_comcast.net)
Date: 11/25/04
- Next message: Dan Pop: "Re: Questions about malloc()"
- Previous message: CJ: "how to link Fortran code in MS visio studio"
- In reply to: os2: "problem to insert data"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: problem to insert data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 25 Nov 2004 10:33:59 -0600
"os2" <marcpirat@yahoo.com> wrote in message
news:844b0dba.0411250812.c4ccfb7@posting.google.com...
> hi
>
> i have an insertion problem with my rtu table
> datatype for date1 field is: datetime
>
> i try to insert local date to the database (mysql)
>
> source code
>
> struct tm *date;
> struct timeval begin;
> struct timeval end;
>
> gettimeofday(&end, NULL);
> date = localtime(&end.tv_sec);
> strftime(datestr, 128, "%F %T", date);
> printf("date str %s", datestr);
> snprintf(query, 512, "INSERT INTO rtu (date1,duration,sensorid)
> VALUES(%s,%d,%d)",datestr, 0, 0);
> res=mysql_query(&my_connection,query);
>
> res display 1 (a error)
>
> datestr display me
> 2004-11-25 15:52:55
>
>
> query variable return
> INSERT INTO rtu (date1,duration,sensorid) VALUES(2004-11-25
> 15:56:11,0,0)
>
>
> any idea?
While I certainly don't possess the omniscience that the loudest voicest
around here do, I'm going to guess that some of your function calls lie
outside the ANSI/ISO Standard. If so, expect four more posts, progessively
shrill, telling you the same thing. MPJ
- Next message: Dan Pop: "Re: Questions about malloc()"
- Previous message: CJ: "how to link Fortran code in MS visio studio"
- In reply to: os2: "problem to insert data"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: problem to insert data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|