阅读背景:

在关闭C中的连接后,返回函数中的MySQL查询的结果

来源:互联网 

I have this weird behavior in C which I do not understand. It is probably me as I am fairly new to C. What I am trying to achieve is to write a function that runs a MySQL query and returns the result. The weird thing is that, in the code below, if I close the connection and free the result (as I would expect the order to be) it seems that the value that I have stored in 'retvalue' is no longer there. When I put the return before the freeing of the result and closing of the connection the value is returned, but obviously the connection is not closed and MySQL will eventually present the error 'too many connections'.I have this weird behavior in C which I do not




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: