ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

PHP on AS400 odbc_connect

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

  • PHP on AS400 odbc_connect

    Hi,

    I have install PHP on my AS400 but i can't ready any file.
    I get a error when making the connection : SQL state 42705.

    Any idear ?

    Thank's for you help

  • #2
    post example of php

    post some of your code and lets take a look.

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Here is the source code.
      Attached Files

      Comment


      • #4
        just to post the code

        Here is the source from above:

        By the way is that DEVELOPMENT ?????
        or DEVELOPPEMENT


        Code:
        <html>
         <body>
         <p align="center">
         <font size="5" face = "Arial"><b>Liste du fichier<br></b></font>
         </p>
         <?php
           $link = odbc_connect("DEVELOPPEMENT", "", "");
           if(!odbc_setoption($link, 1, SQL_ATTR_DBC_DEFAULT_LIB, "BISDB"))   {
           echo "ERREUR : impossible de travailler avec BISDB" ;
           }
           $query="select * BISDB.notepm";
           $result = odbc_exec($link, $query);
         ?>
         <table border ="1">
         <tr>
         <th><b>Nom</th>
         <th>Zone</th>
         </tr>
           Resultat:<br>
         <?php
           if ($result == 0):
           echo ("<B>Erreur " . odbc_error() . ": " . odbc_errormsg()   . "</B>");
           else:
           while(odbc_fetch_into($result,$row_array) != FALSE) {
           echo("<TR>");
           for ($j = 0; $j < odbc_num_fields($result); $j++) {
           echo("<TD>" . $row_array[$j] . "</TD>");
           }
           echo("</TR>");
           }
         ?>
         </TABLE>
         <?php
           endif
         ?>
         </BODY>
         </HTML>

        I will try to get more information for you...
        (we have a long weekend this week)


        check out these links :
        IBM and PHP

        Non-IBM PHP Site


        take care
        Jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Quit a good question !!!!

          The first parameter MUST be the Data Base Name.

          Thank's a lot for your remarque Jamie.

          Comment

          Working...
          X