|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-15 17:40 UTC] matthius at u dot washington dot edu
Using MSSQL 2000 The function mssql_num_rows generates the following warning: Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource At the advice of the documentation I tried making the following query: $query2 = 'SELECT @@ROWCOUNT'; $result2 = mssql_query($query2); list($affected) = mssql_fetch_row($result2); echo($affected); This generates the following error: Warning: MS SQL: Query failed All other queries work fine I can interact with the database. I have also tried the latest stable build on snaps.php.net as of today 8-15-02 the problem remains unchanged. Any help would be greatly appreciated. Thanks! Matt PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
Sorry for not including that detail. Please let me clarify, the actuall query IS valid and it does succeed. It affects about 3300 rows. I am pasting my code snippet: // above is DB connection stuff, all goes well $query = ' DECLARE @Ident int INSERT INTO LastMod (lastModBy, lastModDate) VALUES ("Matt - Email Import Test", GETDATE()) SET @Ident = @@IDENTITY -- insert primary email INSERT INTO EmailAdd (personID, address, emailAddType, lastModID) SELECT newID, Col017, "primary", @Ident FROM fmFullExport WHERE Col017 != "" AND Col002 LIKE "%_%" AND COL003 LIKE "%_%" '; // execute query $result = mssql_query($query); mssql_num_rows($result); // it dies on that last line This is the error message it generates: Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in c:\inetpub\wwwroot\DBclass\index.php on line 36