RE: [PHP-DB] return # of rows
| From: | Arthur Yeo | Date: | Wed, 28 Jun 2000 18:20:37 +0000 |
| Subject: | RE: [PHP-DB] return # of rows | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-705@lists.php.net to get a copy of this message | ||
According to the PHP online manual,
the odbc_do() returns string rather than int
while odbc_exec() returns an int.
Furthermore, odbc_num_rows() is expecting an int for its second arg.
In short, why don't you use odbc_exec() instead?
The manual seem rather terse for odbc_do().
>-----Original Message-----
>From: Chuck Barnett [mailto:cbarnett@netcabtec.com]
>Sent: Wednesday, June 28, 2000 11:22 AM
>To: 'php-db@lists.php.net'
>Subject: [PHP-DB] return # of rows
>
>
>I'm not subscribed to this list fo please reply to me.
>Thanks. I posted
>this on General, but got no answer.
>
>I am just getting a -1 when I run the following code. But the
>result brings
>back 7 or so records.
>
> case "street":
> $query="select * from risks where lo_numb like '$streetno' and
>addr_street_name='$streetname'";
> //echo $query;
> break;
> case "fileno":
> $file_type=substr($fileno,0,1);
> $file_no=substr($fileno,1,strlen($fileno));
> $query="select * from risks where file_type='$file_type' and
>file_num='$file_no'";
> //echo $query;
> break;
>}
>$result=odbc_do($connection, $query);
>
>echo odbc_num_rows($result);
>
>
>^^^^^^ is returning a -1 ????
>
>Iam running php 4.0 with MS SQL 7 on NT 4 IIS4.
>
>Thanks,
>Chuck
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail:
>php-list-admin@lists.php.net
>