Warning: odbc_fetch_row(): 37 is not a valid ODBC result resource
<p>Whats wrong in my code, when I test it the output goes write but in my browser shows the warning that say's "Warning: odbc_fetch_row(): 37 is not a valid ODBC result resource in C:\xampp\htdocs\webinterface\requests.php on line 729" </p>

<p>I don't know what does it mean, the sql statement result just goes fine in dbexplorer. 
by the way may database is paradox and using odbc to connect my php to paradox.</p>

<p>Does anyone can help me? Thanks you very much</p>

<p>my code hereunder:</p>

<pre><code>    $connectionstring = odbc_connect(DB_DNS,DB_USER,DB_PASS);
        $auditRequestNo     = "";
        $ar_requestno   = "";
        $svemp1 = "";
        $svemp2 = "";               
        foreach($uArr as $arNo){                
            $ar_requestno .= (!empty($ar_requestno))? ",".$arNo : $arNo;
            $auditRequestNo   .= (!empty($auditRequestNo))? ",".sprintf("%08d", $arNo) : sprintf("%08d", $arNo);
        }

        $query = "SELECT SV_EmployeeNo,Sv_EmployeeNo2 \r\n".
                        "FROM AuthorizationRequests \r\n".
                        "WHERE ARNO IN (".$ar_requestno.") ";   
        $result = odbc_do($connectionstring, $query);
        while(odbc_fetch_row($result)){
            $svemp1 = odbc_result($result,1);
            $svemp2 = odbc_result($result,2);
            switch(intval($s)){         
                case 1: // approved 
                        if(empty($svemp1) and empty($svemp2)){
                            $update_fields = "flag=0, DateApproved = { d '".date('Y-m-d')."' } , SV_EmployeeNo=".$_SESSION['uen']." ";
                            $update_query =   "UPDATE AuthorizationRequests \r\n".
                                              "SET ".$update_fields."\r\n ".
                                              "WHERE ArNo IN(".$ar_requestno.")";
                            $update_query = odbc_exec($connectionstring, $update_query);
                            odbc_close($connectionstring);                              
                        }else if(!empty($svemp1) and empty($svemp2) and $svemp1 != $_SESSION['uen']){
                            $update_fields = "flag=".$s.", DateApproved2 = { d '".date('Y-m-d')."' } , SV_EmployeeNo2=".$_SESSION['uen']." ";                            
                            $update_query =   "UPDATE AuthorizationRequests \r\n".
                                              "SET ".$update_fields."\r\n ".
                                              "WHERE ArNo IN(".$ar_requestno.")";
                            $update_query = odbc_exec($connectionstring, $update_query);
                            odbc_close($connectionstring); 
                        }
                    #}                
                    break;
                case 2: // rejected
                        $update_fields = "flag=".$s.", DateApproved = { d '".date('Y-m-d')."' }, SV_EmployeeNo=".$_SESSION['uen']." ";
                        $update_query =   "UPDATE AuthorizationRequests \r\n".
                                          "SET ".$update_fields."\r\n ".
                                          "WHERE ArNo IN(".$ar_requestno.")";
                        $update_query = odbc_exec($connectionstring, $update_query);
                        odbc_close($connectionstring); 
                    break;
                default: // reset
                        $update_fields = "flag=0, DateApproved=NULL, SV_EmployeeNo=NULL, DateApproved2=NULL, SV_EmployeeNo2=NULL";
                        $update_query =   "UPDATE AuthorizationRequests \r\n".
                                          "SET ".$update_fields."\r\n ".
                                          "WHERE ArNo IN(".$ar_requestno.")";
                        $update_query = odbc_exec($connectionstring, $update_query);
                        odbc_close($connectionstring); 
                    break;
            }   
        }
</code></pre>
