|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-06 17:16 UTC] tularis@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Description: ------------ I wanted to get the stored procedure of SQL Server2000 using odbc driver.My system configuration is Linux where I used freeTDS to connect to odbc, PHP version 5.2. I used the odbc_prepare() and odbc_execute() method to access the stored procedure but it throws the SQL error code 01S02. I have tried in many ways to solve this out but I failed. Can anyone help me out????? Has any one called the stored procedures of SQL Server2000 using odbc, in Linux???? Reproduce code: --------------- <?php $dsn="MSSQLTestServer"; $user="sa"; $pwd="sysadmin"; $con = odbc_connect($dsn,$user,$pwd,SQL_CUR_USE_ODBC )or die("couldn't connect\n"); echo "connected TO DB ***"; $stmt = odbc_prepare($con,'CALL phptestproc') or die("failed odbc_prepare\n"); echo "\nodbc_prepare ***".$stmt; $a = array("India",1000); $success = odbc_execute($stmt,$a)or die("error in odbc_execute"); odbc_commit($con); odbc_close($con); echo "Successfully added into the database" ?> Expected result: ---------------- The stored procedure in SQL Server2000-[ phptestproc =ALTER procedure phptestprocnew @name varchar(20),@age int as insert into phptest values(@name,@age) ] gets successfully updated Actual result: -------------- connected TO DB *** odbc_prepare ***Resource id #2<br /> <b>Warning</b>: SQL error: [unixODBC][Driver Manager]Option value changed, SQL state 01S02 in SQLExecute in <b>/home/projects/php_project/aphp.php</b> on line <b>18</b><br />