Another PHP and MSSQL problem

Hitman
Soldato
Joined
25 Feb 2004
Posts
2,837
Hi there,

I've got a stored procedure in my MSSQL database that simply selects information and outputs it depending on the parameter.

The script I'm calling this procedure is:

PHP:
<?php
	$db_host = "";
	$db_user = "";
	$db_pwd = "";
	mssql_connect($db_host, $db_user, $db_pwd);

	mssql_query("EXEC [dbo].[procedure name] 'parameter'");

?>
When trying to load this up on the site, it simply shows the following error:

PHP:
Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near '01'. (severity 15) in [I]file[/I] on line 7

Warning: mssql_query() [function.mssql-query]: Query failed in [I]file[/I] on line 7
Slightly confused. I've attached a DBMS to the MSSQL database (EMS SQL Manager) and running the procedure through that outputs the information fine in the console it provides (information is set to "print").

I've never tried outputting information ran through a MSSQL procedure before, so am I doing this wrong or do I need to add some other things to the PHP script its called from?

Cheers
 
Back
Top Bottom