|
|||
|
The code looks like this.
MYSQL *conn; MYSQL_STMT *stmt; ..... /* some code set the conn */ stmt = mysql_stmt_init(conn); if(stmt == NULL) printf("%d\n", mysql_errno(conn)); When I run this, i got that: stmt is NULL, and the printed errno is 0. I checked that the error code of mysql_stmt_init() is 2008 when it's out of memory. So it seems the conn is ok and no error, but the mysql_stmt_init returns NULL. |
|
|
||||
|
||||
|
|
|
|||
|
I'm realy sorry for asking this question , finally i found the reason. It's my bad of write the wrong code, not something wrong with the mysql_stmt_init(). The reason is so stupid and make me feel stupid. I'm sorry for what i have done.
|
|
|||
|
On 02/16/2012 02:15 AM, Xianggang ZENG wrote:
> I'm realy sorry for asking this question , finally i found the reason. It's my bad of write the wrong code, not something wrong with the mysql_stmt_init(). The reason is so stupid and make me feel stupid. I'm sorry for what i have done. We have all been there at least once. Relax, get another cup of coffee, and, enjoy the day. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|