php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26296 Warning: mssql_query(): message: Invalid object name
Submitted: 2003-11-18 01:48 UTC Modified: 2003-11-18 05:07 UTC
From: ameen at whitehouseit dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.4 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2003-11-18 01:48 UTC] ameen at whitehouseit dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-18 05:07 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC