note 69652 modified in function.odbc-fetch-row by danbrown

From: Date: Fri, 25 Jun 2010 13:42:28 +0000
Subject: note 69652 modified in function.odbc-fetch-row by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170421@lists.php.net to get a copy of this message
Since I searched on this error way too long, and I finally found my coding issue for odbc_fetch_row(): ... I wanted to share it. odbc_fetch_row(): x not a valid ODBC result resource where x represents a number. In my case, the close statement was accidently put in an area while I was spinning through records. Once you close it, while trying to get a row, you can get this msg. thrown. <?php while (odbc_fetch_row($rs)) { // do something. } ?> ONLY THEN <?php odbc_close($conn); ?> --was-- Since I searched on this error way too long, and I finally found my coding issue for odbc_fetch_row(): ... I wanted to share it. odbc_fetch_row(): x not a valid ODBC result resource where x represents a number. In my case, the close statement was accidently put in an area while I was spinning through records. Once you close it, while trying to get a row, you can get this msg. thrown. while (odbc_fetch_row($rs)) { do something. } ONLY THEN odbc_close($conn); http://php.net/manual/en/function.odbc-fetch-row.php

« previous php.notes (#170421) next »