Hello everybody,

I have a very big problem:

My system is as followed:
- DB2 on AS400

on Windows 2000
- Apache 1.3.29
- php 4
- system-DSN

Now I am programming a tool which shows data from the DB2 on browser with php-pages.

In my php-code I work with odbc-functions [odbc_connect(), odbc_exec(), odbc_result()].

When I call a page with some variables such as pagename.php?var1=1234, it works and works and works only after 2 - 3 minutes build up the page. Even though there are a few records on the page. :o 😕

Does anyone have a idea how I can solve this problem.

Please help me.

Thanks a lot in advance

best regards
Otto

    Hello,

    please help me, if you know the problem.

    thanks a lot

    Otto

      maybe something to do with a loop in your code? what are the server CPU specs?

      I used to use ODBC and now I use MYSQL 🙂

        Hello,

        my web-server ist a P4 1.8 GHz 256 MB RAM.

        maybe something to do with a loop in your code?

        What do you mean? Where should I use a loop?

        Here is a part of my code:

        $DSN = "AS400PHP";
        $Connection = odbc_connect($DSN,'name','password');
        $KDLFN =  $_GET['KDLFN'];
        $DLR = 90;
        
        $qryStandort = "SELECT SOSNR, SOSNA, SOLKZ, SOSTR, SOHNR, SOPLZ, SOORT FROM TKDFTEST.TKDSTO
        					WHERE SOFNR = '$DLR' AND SOSNR IN (SELECT GSSTO FROM TKDFTEST.TKDGST
        					WHERE GSFNR = '$DLR' AND GSGID IN (SELECT KDGID FROM TKDFTEST.TKDKDA WHERE KDLFN = '$KDLFN'))";
        	$ergStandort = odbc_do($Verbindung, $qryStandort);
        
        $SOSNR = odbc_result($ergStandort, 1); // StandortNr
        $SOSNA = ucwords(strtolower(odbc_result($ergStandort, 2))); // Standortname
        $SOLKZ = odbc_result($ergStandort, 3); // Länder KZ.
        $SOSTR = ucwords(strtolower(odbc_result($ergStandort, 4))); // Straße
        $SOHNR = odbc_result($ergStandort, 5); // HausNr
        $SOPLZ = odbc_result($ergStandort, 6); // PLZ
        $SOORT = ucwords(strtolower(odbc_result($ergStandort, 7))); // Ort
        odbc_close($Connection);
        

        Thanks

        Otto

          nm about the loop part. Umm hmmm i would say ether something is set up wrong or the database u are using is just to slow 🙂 ur using PHP db2 database? never heard of that. From my experience with PHP i started with ODBC and MSACCESS. It was slow compared to Mysql and alot of things involved in getting it to work. why not set up a mysql database and test it against the code that is going slow right now?

          I can help you through the code conversion process if you need any and also do any of your PHP scripts also run slow that dont have database querys?

            Hi,

            ur using PHP db2 database?

            yes, I'm using PHP with a db2 database on an AS400-system.

            My other php-scripts which dont have querys, work ok.

            If there is no other chance I'll act on your advice and install a mysql-system to compare the performancedefference. But it is wasteful ;-)

            Thanks

            Otto

              Originally posted by otto-mueller
              Hi,

              yes, I'm using PHP with a db2 database on an AS400-system.

              My other php-scripts which dont have querys, work ok.

              If there is no other chance I'll act on your advice and install a mysql-system to compare the performancedefference. But it is wasteful ;-)

              Thanks

              Otto

              do u have to use db2? why not use mysql. I find the odbc can have many problems and stuff just from the server computer. I found mysql much easier.

                by the way what version of db2 u running?

                check your pms

                  Write a Reply...