Hi Wayne,

>     My guess is that  is that 'conn' is invalid in 'result = 
> >PQExec(conn,"BEGIN");'
Unfortunately, I am sure this is not the problem, as the error trapping 
would have picked this up. One strange thing to note is that this BEGIN 
statement was originally called right before I executed the sql query.
When I moved this (for debugging) so it would execute right after the 
connection was made to the database, it did the BEGIN fine, but the porgram 
then stopped right after PQExec(conn, sqlstr), again, not even making it to 
the error trapping on the next lines.

>     You can also log progress to a file eg.
>
>     void log_msg(char *fmt, ...)
>     {
>         FILE *fd = fopen("/tmp/mylog", "a");
>         va_list arglist;
>
>         va_start(arglist, fmt);
>         vfprintf(fd, fmt, arglist);
>         fclose(fd);
>     }
I'm not familiar with vs_list and va_start (though I can guess that 
vfprintf() is probably a variant of fprintf()), could you give a brief 
explanation?

>   The you can do things like
>
>     log_msg("SQL is : ", sqlstr);
>
>   The msg will always get written as the file is open and closed on > each 
>call. And no it won't slow your script down very much, you >probably won't 
>even notice.
That;s alright, I'll probably just remove these statements after debugging 
is done.
>/tmp is writeable by all
>users, so its a good place to put the
>   log.
Great, thanks for the tips Wayne. I think I might just rewrite it from 
scratch, and if that fails, I'll just post up the source.
Regards,
Alex

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to