Kathiravan's

Wednesday, September 7, 2011 Written By: Kathiravan Manoharan

Informix Database Connectivity from PHP Application Server

Source: http://www.iiug.org/library/ids/technical/sg247218.pdf

$link = ifx_connect("sysmaster@on1000UC3soc","informix","123456");
if ( !$link ) {
        printf("");
        printf("Connect: Returncode %s -- %s \n",ifx_error(), ifx_errormsg());
        printf("");
        exit();
}
$tab_list = ifx_prepare ("SELECT tabname FROM systables",$link);
$return=ifx_do($tab_list); Chapter 5. PHP applications with Informix database servers  221
if ( $return == 0 ) {
        printf("");
        printf("Select: Returncode %s -- %s \n",ifx_error(), ifx_errormsg());
        printf("");
        exit();
}
ifx_htmltbl_result($tab_list,"border=\"2\"");
ifx_free_result($tab_list);
@ifx_close($link);
?>

-----------------------------------

Example 5-24   Missing INFORMIXSERVER in the Apache environment
/usr/local/bin/php ifxconnect.php

Warning: ifx_connect(): E [SQLSTATE=IX 000  SQLCODE=-25560] in 
/usr/local/apache2/htdocs/ifx/connect/ifxconnect.php on line 3
Connect: Returncode E [SQLSTATE=IX 000  SQLCODE=-25560] -- Environment 
variable INFORMIXSERVER must be set.


-----------------------------------

Example 5-23   Missing INFORMIXDIR in the Apache environment
/usr/local/bin/php ifxconnect.php

Warning: ifx_connect(): E [SQLSTATE=IX 001  SQLCODE=-1829] in 
/usr/local/apache2/htdocs/ifxconnect.php on line 3

-----------------------------------

Example 5-21   Database server name in connection string is wrong
/usr/local/bin/php pdoconnect.php

Error!: SQLSTATE=HY000, SQLDriverConnect: -25555 [Informix]
[Informix ODBC Driver][Informix]Server on1000UC3soc1 is not listed as a 
dbserver name in sqlhosts.

For more information:


Featured Blog Topics:

0 comments:

 

Featured Blog Topics:-