Thursday, 15 September 2011

mysqli php prepared statement fetch() method return "uninitialized" -



mysqli php prepared statement fetch() method return "uninitialized" -

i trying below php code, $prepstmt->fetch() method returns uninitialized. of methods prepare(), bind_param(), bind_result() etc returns true fetch() returns "uninitialized" code never enters while loop. using php v5.5.

i have tried numerous things name few moving execute() method or downwards relative postion alter wrt other methods (if ordering imp), called store_result() before fetch()

i tired of googling not able find solution. first php project , stuck. please 1 help me out. have sec eye , identify missing. pls pls help me out bcoz much frustated now.

$prepstmt = $msqli->prepare("select bank_id,bank_name,loan_rate msdb1.loan_rates bank_id in (?) , from_amount = ? , to_amount <= ? , floating = ? , salaried in (?) , professional in (?) , gender = ?"); $prepstmt>bind_param("siissss",$bnkidfmtlist,$frmamt,$toamt,$inttype,$bind_sal, $bind_pro,$gender); $meta = $prepstmt->result_metadata(); while ($field = $meta->fetch_field()) { $parameters[] = &$row[$field->name]; } call_user_func_array(array($prepstmt, 'bind_result'), $parameters); $prepstmt->execute(); while ($prepstmt->fetch()) { $x = array(); foreach($row $key => $val) { $x[$key] = $val; } $results[] = $x; }

php mysqli prepared-statement

No comments:

Post a Comment