php-windows Digest 20 Sep 2005 07:08:28 -0000 Issue 2780

Topics (messages 26359 through 26365):

MySQL Problem
        26359 by: Vincent Kruger
        26360 by: Vincent Kruger
        26361 by: Mikey
        26364 by: Armando

Re: Calling MSSQL Stored Procedure
        26362 by: Alf Stockton
        26363 by: Robert Twitty
        26365 by: Alf Stockton

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
My php 5.0.5 doesn't want to load the mysql module and the libmysql file is
in the root directory of php I just can't seem to get it working. I've also
upgraded to mysql 4.1.12 but that’s working fine.

Please help.

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 2005/09/16
 

--- End Message ---
--- Begin Message ---

-----Original Message-----
From: Vincent Kruger [mailto:[EMAIL PROTECTED] 
Sent: 19 September 2005 04:42 PM
To: '[email protected]'
Subject: MySQL Problem

My php 5.0.5 doesn't want to load the mysql module and the libmysql file is
in the root directory of php I just can't seem to get it working. I've also
upgraded to mysql 4.1.12 but that’s working fine.

Please help.

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 2005/09/16
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 2005/09/16
 

--- End Message ---
--- Begin Message ---
Vincent Kruger wrote:

My php 5.0.5 doesn't want to load the mysql module and the libmysql file is
in the root directory of php I just can't seem to get it working. I've also
upgraded to mysql 4.1.12 but that’s working fine.

Please help.

Have you enabled it in the extensions section of the php.ini file?

Mikey

--- End Message ---
--- Begin Message --- Try dropping the libmysql.dll file in your windows/system32 directory. Or add the PHP directory to your PATH environment variable. Cheers.

Armando

Mikey wrote:
Vincent Kruger wrote:

My php 5.0.5 doesn't want to load the mysql module and the libmysql file is in the root directory of php I just can't seem to get it working. I've also
upgraded to mysql 4.1.12 but that’s working fine.

Please help.

Have you enabled it in the extensions section of the php.ini file?

Mikey


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
Hi Alf

Based on a previous posting, the code for the stored procedure
spGetActivePromotions does not return a value. Therefore, $ret is going to
be undefined. The procedure returns a result set that you must iterate
via $rs:

    while (!$rs->EOF) {
        print_r($rs->fields);
        $rs->MoveNext();
    }

-- bob

> 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
>
>

--- End Message ---
--- Begin Message ---
Robert Twitty wrote:

Hi Alf

Based on a previous posting, the code for the stored procedure
spGetActivePromotions does not return a value. Therefore, $ret is going to
be undefined. The procedure returns a result set that you must iterate
via $rs:

   while (!$rs->EOF) {
       print_r($rs->fields);
       $rs->MoveNext();
   }

Hello Bob,
I have tried the above and still I get a blank page back. No data no errors nothing. I have also looked in Apache logs and there is a reference in the access.log but nothing in the error.log. I have attached a copy of my program just in case you can see from that what I have done wrong.
BTW I have attempted both dates with the same result.
I have also checked and yes the ODBTP server is running as an Apache service.

--

Regards,
Alf Stockton            www.stockton.co.za

Q:      Why do firemen wear red suspenders?
A:      To conform with departmental regulations concerning uniform dress.

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

Attachment: reg2.php
Description: application/php


--- End Message ---

Reply via email to