Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and MSSQL problem with query

Status
Not open for further replies.

BB101

Programmer
May 23, 2001
337
GB
I am currently building a web application with PHP, MSSQL and a lot of javascript.

I have a problem on one of my pages.

The query:
exec spCCH_ChapterAta_List 'Hercules01'
Does not run in the PHP, no error is returned, just "Query failed", but it runs in query analyzer; however I can run:
exec spCCH_ChapterAta_List 'BenTest'
Just fine, works in both.

Anyone had any problems like this before?

Thanks

--BB
 
$query = mssql_query($SQL, $this->_DBCon) or (DIE(&quot;ERROR IN <b><pre>&quot;.htmlentities($SQL).&quot;</pre></b><br><b>&quot;.mssql_get_last_message().&quot;</b>&quot;));


The error returned from mssql_get_last_message simply says database context changed, which is correct.

Thanks

--BB
 
yes, everything works fine in query analyzer, just fails in PHP

--BB
 
yes, this is a rebuild of the original frontend; ASP (ick), to PHP (yum).

--BB
 
yes, I am logging in with the same creditials... its not an MSSQL problem, its a PHP problem.

I'm not new to this coding lark, but this has me stumped

--BB
 
server is running 2k, IIS, PHP 4.3.1 under isapi with mssql, pdflib, mysql, gd2.

Worked fine a few days ago.

/me harasses his IT department

--BB
 
We had a power cut... otherwise apart from the date its all the same

--BB
 
yes, pasted code into QA works fine!

I've done all the obvious things, I'm stuck!

--BB
 
PHP environment:
IIS, PHP 4.3.1 isapi, mssql, pdflib, sockets, gd2

Connecting to mssql through mssql library with PHP

MSSQL version 2000, running on the same box

--BB
 
I'm racking my brain...

I had a similar problem once where a query would run through QA but not through ASP. But it was more than 5 years ago, so I don't remember what my fix was.

I don't run PHP on Win32, but on Linux. Does the MSSQL communication library ship with PHP, or do you need to use one supplied by Mi&cent;ro$oft?

I'm just trying to classify the differences between now QA would query the database and how PHP would.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
The mssql library ships with PHP, i don't think microsoft ever got near it (though I could be wrong).

--BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top