Skip to Content.
Sympa Menu

freetds - Re: [freetds] Warning: odbc_fetch_row(): 6 is not a valid ODBC result resource in /var/www/localhost/htdocs/customer.microprecision.com/invlist.php on line 81

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Warning: odbc_fetch_row(): 6 is not a valid ODBC result resource in /var/www/localhost/htdocs/customer.microprecision.com/invlist.php on line 81
  • Date: Tue, 24 Feb 2009 22:21:04 -0500

Ran September wrote:
> i don't know where i went wrong, my script seems alright and i'm
> pretty sure that i prevented the "Multiple active statement" thing (at
> least that's what i believed)
>
> $conn=odbc_connect($db_host,$db_user,$db_pass);
> $sql="SELECT * FROM invoice where customer = '$custid' AND
> INVOICE.WO_CUSTOM2 != 'MPTE'";
> $rs=odbc_exec($conn,$sql);
> if (!$rs)
> {exit("Error in SQL");} (---------------------->>> the connection
> worked! <<<---------------------------)
> ?>
>
> odbc_binmode($rs, ODBC_BINMODE_PASSTHRU);
> odbc_longreadlen($rs, 100384); /* Allow 16kb thru */
> while (odbc_fetch_row($rs)) (--------------------->>> this
> is where the error pointed at <<<------------------)

Try looking at a TDSDUMP log of the session; see if any error message is
generated in response to odbc_longreadlen. (I'm not a PHP programmer, but
do odbc_binmode() and odbc_longreadlen() not have return codes?) You
might also try using the ODBC trace.

Four our purposes here, you need to isolate the ODBC function call that is
not working as expected. Then we can see what is reasonable to expect,
and what kind of change or righteous indignation would be appropriate.

> and also, using freetds, can it load pdf files? if yes, is there a
> limit from loading big files? because it worked on windows i mean when
> the time that i didn't have to use freetds driver.

Yes, it should work. You're limited by available memory -- more than one
copy of the file is kept in memory -- and newer versions are better at it
than older ones. I don't know how well ODBC parameterized queries work
with large parameters. Here again an ODBC trace and TDSDUMP should shed
some light.

HTH.

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page