alin19 Posted November 29, 2010 Share Posted November 29, 2010 I have this code: it connects to the database, start the statement but i get an error at mssql_execute : PHP Warning: mssql_execute(): stored procedure execution failed in /home/alin/NetBeansProjects/MailScanner/index.php on line 30 the procedure in the db looks like this: GetUsernames (@resultsCount Int=1); resultsCount indicates the number of usernames to return. SELECT STMT Returns Username, ServerList i can't figure it out, need some help please, $ParameterOne=1; $Parameterdoi=""; $ParameterTrei=""; $conn = mssql_connect("***","***","***"); if ($conn===false) { } if (mssql_select_db("***",$conn) === false) { } $proc = mssql_init('GetUsernames',$conn); mssql_bind($proc,'@resultsCount',$ParameterOne,SQLINT1,true, false, 10); mssql_bind($proc,'Username',$Parameterdoi,SQLVARCHAR); mssql_bind($proc,'ServerList',$ParameterTrei,SQLVARCHAR); if ($result = mssql_execute($proc)) { if ($row = mssql_fetch_row($result)) { } } Quote Link to comment Share on other sites More sharing options...
alin19 Posted November 29, 2010 Author Share Posted November 29, 2010 i have fixed it, the problem was not in the code: looks like with mssql you have to define in : /etc/freetds/freetds.conf the server like this: # A typical Microsoft server [MyServer7] host = **** ; port = 1433 tds version = 8.0 and then connect like this cu mssql_connect("MyServer7",username,parola); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.