Re: Re: Calling MSSQL Stored Procedure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Twitty wrote:

Since you are using php_mssql.dll, you should use php_odbtp.dll instead of
php_odbtp_mssql.dll to prevent namespace conflicts. The ADODb driver name
is 'odbtp', and the database connection should be performed similar to the
following:

   $db = NewADOConnection('odbtp');

   // Connect to database via ODBTP server
   $odbtp_server = '127.0.0.1';
   $odbc_conn = 'DRIVER={SQL Server};SERVER=mysqlserver;'
              . 'UID=myuid;PWD=mypwd;DATABASE=mydb; ';
   if( !$db->PConnect( $odbtp_server, $odbc_conn ) ) {
       print $DB->ErrorMsg();
       die;
   }

Robert, first let me thank you for your patience. I have copied the above into my program making minor changes as follows :-
$PMdriver = "odbtp";

   $PMdb = NewADOConnection('odbtp');
   $PMdb->debug = true;

   // Connect to database via ODBTP server
   $odbtp_server = '127.0.0.1';
   $odbc_conn = 'DRIVER={SQL Server};SERVER=localhost;'
              . 'UID=sa;PWD=;DATABASE=pm; ';
   if( !$PMdb->PConnect( $odbtp_server, $odbc_conn ) ) {
       print $PMdb->ErrorMsg();
       die;
   }
   $SQL = $PMdb->PrepareSP('spGetActivePromotions');
   if (!$SQL) {
       print $PMdb->ErrorMsg();
       die;
       }

   $ActualDate = time();

   $PMdb->Parameter($SQL, $ActualDate, "Today");
   $PMdb->Parameter($SQL, $ret, 'RETURN_VALUE', $isOutput=true);
   $rs = $PMdb->Execute($SQL);
   if (!$rs) {
       print $PMdb->ErrorMsg();
       die;
       }

   echo $ret;

and I get nothing back, no error messages either on the screen or in Apache error.log but I do see a connection in the Apache logs.
Please tell me what I have now got wrong.

--

Regards,
Alf Stockton		www.stockton.co.za

Perilous to all of us are the devices of an art deeper than we ourselves
possess.
		-- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]

My email disclaimer is available at www.stockton.co.za/disclaimer.html

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux