Found the workaround to the problem.

It had to be a PHP bug because odbc_fetch_row() should return true if there
is 1 row, not false.  I also file a PHP bug at bugs.php.net, the bug number
is 19528.

Here's the workaround I made, I added "$bug_workaround" to the script.

--clip--
$cid = odbc_connect('blah blah blah');
$ask7 = "SELECT * FROM INQUIRIES WHERE USER_ID = '38SCK3'";
$R7 = odbc_exec($cid,$ask7);
$result = odbc_result($R7,1);

echo "Result or No Result??? --> ".odbc_fetch_row($R7);

$bug_workaround=0;
//while (odbc_fetch_row($R7))
while (odbc_fetch_row($R7,++$bug_workaround))
{
 odbc_fetch_into($R7,$inquiry,$inq_c);
 echo $inquiry[0], $inquiry[1];
}
--clip--"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Fellas!
>
> I'm a little bit confused as to why does this not work right!  It had to
do
> with the odbc_fetch_row() function.  When there is two or more rows, the
> odbc_fetch_row() return a True.  When there's no row, the odbc_fetch_row()
> return a False.  What so odd about it is when there is one row,
> odbc_fetch_row() return a False.  It should return a True.  This doesn't
> make sense.  Is this a bug?  Have anyone encountered this problem??  What
is
> the workaround to it?
>
> Thanks!
>
> --clip--
> $cid = odbc_connect('blah blah');
> $ask7 = "SELECT * FROM INQUIRIES";
> $R7 = odbc_exec($cid,$ask7);
> $result = odbc_result($R7,1);
>
> while (odbc_fetch_row($R7))
> {
>  odbc_fetch_into($R7,$inquiry,$inq_c);
>  echo $inquiry[0], $inquiry[1];
> }
> --cilp--
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to