ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

null values in db using php/pdo

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • null values in db using php/pdo

    hello all -

    ive got a bit of a problem dealing with null values in my database. im trying to read in recordsets in php that happen to have a few null values. im using PDO in php through the linux iSeries odbc driver.

    My development server deals with the null values fine, but when i move the same php code over to the production server I get seg faults in apache whenever I try to access a recordset or row with a null value. The error is found in the apache error log - nothing display on the screen and the log only states 'child pid ##### exit signal Segmentation fault (11)'. Both servers point to the same database - v5r4 and both servers have identical drivers (as far as I can tell).

    development server has php version 5.2.6 Apache version 2.2.8
    production server has php version 5.2.9 Apache version 2.2.11

    ive already tried setting the attribute PDO::ATTR_ORACLE_NULLS to everything it allows, but doesnt seem to get it to work on any of its settings.

    any suggestions?
    thanks

  • #2
    Re: null values in db using php/pdo

    Try googling the error message. It appears to be an Apache set-up thing with conflicts between mod_perl and mod_php.

    Comment


    • #3
      Re: null values in db using php/pdo

      thanks for the reply - the apache modules was one place that I wasn't looking. But even after configuring apache with identical modules on both the development and production servers, it still seg faults.

      As far as the mod_perl - neither server is running apache with it.

      Searching on google, the only thing I can figure out is that PDO is still being worked on and not everything is working as it should be - which leads to seg faults - for a bunch of different reasons.

      My only option right now is changing all the null data in the database and to setup non-null defaults for all the fields.....

      Anymore thoughts?

      Comment


      • #4
        Re: null values in db using php/pdo

        Sorry dude, looks like you're going to have change the data as you say. A bit of a bummer that.

        I'd love to help you, but unfortunately I'm very busy that day

        Comment


        • #5
          Re: null values in db using php/pdo

          there is no way im switching all my nulls to default strings/integers....i just love my nulls way too much....

          that said, I put a trace on my odbc driver and it looks as if its the driver crashing - the last thing it returns when reading data with nulls is an 'sql success' but it doesnt go any further - basically when it hits the first null it stops reading.....when i take the nulls out and run it again it hits that spot that had the null and continues to bring that data in and pass it off.

          Im still not sure as to whether its a driver problem or a php/pdo problem, but im led to believe its the driver - especially when the major difference between my two servers is the architecture - 32bit driver works, 64 bit driver doesnt....

          anyone else have any suggestions or have had any problems with the linux iseries 64bit odbc driver?

          Comment


          • #6
            Re: null values in db using php/pdo

            Don't forget to stop and restart your apache server after making the config changes. Some config changes don't take effect until after the server is restarted.
            Michael Catalani
            IS Director, eCommerce & Web Development
            Acceptance Insurance Corporation
            www.AcceptanceInsurance.com
            www.ProvatoSys.com

            Comment


            • #7
              Re: null values in db using php/pdo

              In an idle moment I went browsing about the web and it seems that the Linux ODBC error is not entirely limited to the iSeries.

              For what it may be worth, check out these links:
              http://www-01.ibm.com/support/docvie...id=swg1IY62758

              http://bugs.php.net/bug.php?id=42068

              Comment

              Working...
              X