Go Back   Rhinocerus > Newsgroup > Newsgroup comp.databases.mysql

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-16-2012, 04:42 AM
Xianggang ZENG
Guest
 
Posts: n/a
Default strange error with mysql_stmt_init()

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.
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 02-16-2012, 06:15 AM
Xianggang ZENG
Guest
 
Posts: n/a
Default Re: strange error with mysql_stmt_init()

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.
Reply With Quote
  #3 (permalink)  
Old 02-16-2012, 01:00 PM
William Colls
Guest
 
Posts: n/a
Default Re: strange error with mysql_stmt_init()

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.
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 07:51 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.