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

Reply via email to