"Uknown command" error from mysql_stmt_prepare

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I am getting this error message when trying to use prepared
statements. My code is:

/* mysock is an opened MYSQL* connection */

char *querystr = "SELECT * FROM foo";
MYSQL_STMT *stmt = mysql_stmt_init(mysock); /* returns non-null */
if (mysql_stmt_prepare(stmt, querystr, strlen(querystr))
    /* error */
    errstr = mysql_stmt_error(stmt);   /* = "Unknown command" */

This code is pretty much straight from the MySql manual pages. Am I
missing something?

Any help will be greatly appreciated.


ken bass
kbb AT softsteps DOT com

Site Timeline