Hi Peter, from what I hear (and what I've read) with sqlServer you'll always get a result of -1 for num_rows. To get an accurate count you'll have to use the count() on the db in a select query. That's one workaround, no doubt there are others.
SELECT COUNT(my_id) FROM TABLE ... Cheers Joe :) "Peter Lavender" <[EMAIL PROTECTED]> wrote in message 017301c171b9$dab26f60$090ba8c0@winnie">news:017301c171b9$dab26f60$090ba8c0@winnie... > Hi Everyone, > > As the subject says. > > I'm using 4.0.6 on IIS/win2k to a MSSQL 2000 database. > > I wish to check if a query returns any values, so the code I have is nothing > more than: > > $numRows = odbc_num_rows($result); > print ("$numRows<br>"); > if ($numRows <= 0) { > > print("Nothing to show"); > > } > > Have I missed something.. with the result always being -1, it causes me some > problems.. :) > > Thanks > > Pete > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]