An Entrepreneur, Coach, IT Consultant, Strategic Adviser, and a Traveler craving to explore and contribute to forming a better society.

Wednesday, September 7, 2011

Informix Database Connectivity from PHP Application Server

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

Problem/Error:









Reason:
INFORMIXSERVER variable will tell your PHP engine where to look for the Informix Service. As the variable is not, PHP engine couldn't find where the informix engine is.

Connecting Informix from PHP Application Server is a challenging task at times. The following piece of code will allow you to test the connectivity:

Solution:

$Informix_Server_Name = "ol_ids_1150_1";
putenv("INFORMIXSERVER=".$Informix_Server_Name);


Example:

$Informix_Server_Name = "ol_ids_1150_1";

putenv("INFORMIXSERVER=".$Informix_Server_Name);

$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);
?>


For more information:

2 comments :

Kathiresan Muthu said...

Hi this is Kathiresan i am having 3 years of experience as a dot net developer and i am certified. i have knowledge on OOPS concepts in .NET but dont know indepth. After learning android will be enough to get a good career in IT with good package? and i crossed Android Training in Chennai website where someone please help me to identity the syllabus covers everything or not??

Thanks,
kathiresan

Kathiresan Muthu said...

Hi this is Kathiresan i am having 3 years of experience as a dot net developer and i am certified. i have knowledge on OOPS concepts in .NET but dont know indepth. After learning android will be enough to get a good career in IT with good package? and i crossed Android Training in Chennai website where someone please help me to identity the syllabus covers everything or not??

Thanks,
kathiresan