Misunderstanding mssql_query in the manual

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am apparently misunderstanding the mssql_query entry in the manual.

The manual reads:-
Returns: A MS SQL result resource on success, *TRUE* if no rows were returned, or *FALSE* on error.

From that I believe that if I test result for TRUE I should report a no data available and if FALSE display a system errror

So my code reads:-

$SQL = sprintf("select a_date, a_time, amnt from register where mac_name = '%s' and message_id = 34 or message_id = 35 order by a_date desc, a_time desc", $MachineNum); $rs = mssql_query($SQL, $link) or trigger_error(sprintf('Query failed: %s', mysql_error()), E_USER_ERROR);
   if(($rs = TRUE)) {
trigger_error (sprintf("No data exists for machine %s", $MachineNum),E_USER_ERROR);
       die;
       }

No matter what is entered I always get "No data exists......."
Please tell me what I am misunderstanding.

--

Regards,
Alf Stockton		www.stockton.co.za

Q:	Why was Stonehenge abandoned?
A:	It wasn't IBM compatible.

My email disclaimer is available at www.stockton.co.za/disclaimer.html

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux