From: ameen at whitehouseit dot com
Operating system: Windows 2000 Server
PHP version: 4.3.4
PHP Bug Type: MSSQL related
Bug description: Warning: mssql_query(): message: Invalid object name

Description:
------------
Just i try to connect my database in SQL Server and fetch some records
from the database. But it shows warning message like this.

Warning: mssql_query(): message: Invalid object name 'mytable'. (severity
16) in D:\abc\Conn.php on line 21

Warning: mssql_query(): Query failed in D:\abc\Conn.php on line 21

How to rectify? i'm sure tables exists in my db. and also connection
establishes perfectly.

Reproduce code:
---------------
$i=mssql_connect("localhost","uid","pwd") or die("unable to Connect");
if (mssql_select_db("mydb",$i)==true)
echo "DB Exists";
else
echo "DB Not Exists";

$sql="select * from mytable where login_id='myname'";

$rs=mssql_query($sql,$i);

Expected result:
----------------
Warning: mssql_query(): message: Invalid object name 'mytable'. (severity
16) in D:\abc\Conn.php on line 21

Warning: mssql_query(): Query failed in D:\abc\Conn.php on line 21


Actual result:
--------------
Fetch Records from db

--
Edit bug report at [url]http://bugs.php.net/?id=26296&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=26296&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=26296&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=26296&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=26296&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=26296&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=26296&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=26296&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=26296&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=26296&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=26296&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=26296&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=26296&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=26296&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=26296&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=26296&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=26296&r=float[/url]