php - CLI0145E db2_fetch_array -


i'm working db2 in php , i'm getting following error while executing

@$row = db2_fetch_array( $res ); [ibm][cli driver] cli0145e fetch type out of range. sqlstate=hy106 sqlcode=-99999 

i found here possible explanation, doesn't make sense me because i'm not specifying row number.

does can give explanations?

thanks!

i believe have misunderstood suggestion contained in page referenced. not referring db2_fetch_array() function, db2_connect() function. set cursor option db2_scrollable, pass constant fourth parameter of database connection function:

db2_connect('database', 'username', 'password', db2_scrollable); 

if not correct solution, maybe displaying error because result contains 0 rows? idea check make sure @ least 1 row returned before calling db2_fetch_array() (or related function):

if (db2_num_rows($res) > 0){   @$row = db2_fetch_array( $res ); } 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -