[unixODBC-support] differences between php_odbc_nun_rows and isql command output

Roger Peña Escobio orkcu at yahoo.com
Mon Dec 12 15:35:14 GMT 2005



--- Brian Morton <bmorton at secureworks.com> wrote:

> >From the php site:
> <?php
> function better_odbc_num_rows($con,$sql){
>    $result = odbc_exec($con,$sql);
>    $count=0;
>    while($temp = odbc_fetch_into($result,
> &$counter)){
>        $count++;
>    }
>    return $count;
> }
> ?>
thanks, I already know about that workaround and also
the one using count(*) in the sql query, which I think
is faster but ... 

I was just ready to go with any of those until I found
the problem I mention, isql command work !!! it return
the right number _always_, so is not a problem with
the odbc driver nor with unixODBC, as far as I can see
because isql use the same files that php-odbc module
use, so, I am trying to giving me a last oportunity to
find the problem in the php module, I was looking for
your expert opinion, your experience with odbc :-)
I am a complete newbe in this field


any way thanks for your anwser
roger

> -----Original Message-----
> From: Roger "Peña" Escobio [mailto:orkcu at yahoo.com] 
> Sent: Monday, December 12, 2005 9:28 AM
> To: Support for the unixODBC project
> Subject: [unixODBC-support] differences between
> php_odbc_nun_rows and isql
> command output
> 
> Hi
> please appologies for asking php stuff in this list,
> but I coundn't find any
> other place where to ask about odbc specific
> problems with php
> 
> I am having problems with the odbc_nun_rows() php
> function to get the number
> of rows I get from a query, it always return -1
> (from the php site it looks
> that it is a very common problem) but when I run the
> same query with isql
> command I get the right results.....
> 
> my next stept was to find any difference in the way
> each client ask for the
> num_rows, but both use the same SQL function:
> SQLRowCount() prety much in
> the same way :-( I get stuck so anybody here know
> the reason of this
> behaivor or just may help me to continue the
> research to find and fix this
> bug ?
> 
> both clients: php and isql, use the same enviroment:
> unixODBC and freeTDS packages, MSSQL-2k server
> [roger at sauron ~]$ rpm -q
> unixODBC
> unixODBC-2.2.9-1
> [roger at sauron ~]$ rpm -q freetds
> freetds-0.63-1.2.el4.rf
> [roger at sauron ~]$
> 
> and CentOS-4.2+updates linux distribution addicional
> information: I compiled
> the most recent
> php4 (4.4.1) with no diffence with the one supply by
> the distribution
> 
> thanks in advance for any tip
> 
> roger
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
>
http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
>
http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the unixODBC-support mailing list