|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2002-10-18 13:17 UTC] pptiezzi at erreuno dot net
 I'm using Openlink Multi Tier Driver for accessing a Informix 7.2 Database on a Linux box from PHP scripts running on the Apache Web Server on a different Linux Box.
PHP version 4.2.3
Openlink version 4.2.7
Apache Version 1.3.12
I'm tested Openlink driver and DSN setup with Openlink test program odbctest: It work fine.
This script work fine:
<?
$db = odbc_connect("$dsn", "$user", "$password");
$sql = "Select codice,name,address from clienti where codice = '$codice'";
if($result = odbc_do($db, $sql))
  {if($db1 = odbc_fetch_into($result, $myrow))
     do{printf("
         ........     
       }while((odbc_fetch_into($result, $myrow));
   }
?>
This script fail... (The same sql statement work fine with odbctest)
<?
$db = odbc_connect("$dsn", "$user", "$password");
$sql = "Select codice,name,address, zipnum from clienti, ziptable where codice = zipcode and codice = '$codice'";
if($result = odbc_do($db, $sql))
  {// The $result connect string is OK and the correct
   // number of rows is returned....
   $numrows = odbc_num_rows($result); // O.K.
   // Nothing is returned from the following function..
   if($db1 = odbc_fetch_into($result, $myrow))
     do{printf("
         ........     
       }while((odbc_fetch_into($result, $myrow));
   }
?>
odbc_fetch_row also returns nothing.
PHP configuration:
./configure' '--with-apxs=/usr/sbin/apxs' '--with-ftp' '--with-config-file-path=/etc/httpd' '--with-informix' '--with-iodbc=/usr/local/openlink/odbcsdk'
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 07:00:01 2025 UTC | 
Notes: '--with-informix' Imho it should be "-with-informix=yes". But if you make (make install) worked, that should be no problem. Why do you use a => $db = odbc_connect("$dsn", "$user", "$password"); if you could use a => $connect = ifx_connect("$database@IFX_SERVER", "$user", "$password"); ? To your problem: What happens if you run the statment: "Select codice,name,address, zipnum from clienti, ziptable where codice = zipcode and codice = '$codice'" in DBACCESS? Please give me examples for "codice", "zipcode" and "$codice". (Since JOIN here.) "This script fail..." I assume there is no error? Regards, Claus