<HTML ><HEAD ><TITLE >Ora_Logon</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK REL="HOME" TITLE="PHP Manual" HREF="manual.html"><LINK REL="UP" TITLE="Oracle functions" HREF="ref.oracle.html"><LINK REL="PREVIOUS" TITLE="Ora_Logoff" HREF="function.ora-logoff.html"><LINK REL="NEXT" TITLE="Ora_Open" HREF="function.ora-open.html"></HEAD ><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.ora-logoff.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.ora-open.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.ora-logon" >Ora_Logon</A ></H1 ><DIV CLASS="refnamediv" ><A NAME="AEN20462" ></A >Ora_Logon -- open an Oracle connection</DIV ><DIV CLASS="refsect1" ><A NAME="AEN20465" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><P ></P ><CODE CLASS="FUNCDEF" >int ora_logon</CODE >(string user, string password);<P ></P ></DIV ><P > Establishes a connection between PHP and an Oracle database with the given username and password.</P ><P > Connections can be made using <SPAN CLASS="productname" >SQL*Net</SPAN > by supplying the <SPAN CLASS="acronym" >TNS</SPAN > name to <TT CLASS="parameter" ><I >user</I ></TT > like this: <DIV CLASS="informalexample" ><P ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="programlisting" > 1 2 $conn = Ora_Logon("user<I CLASS="emphasis" >@TNSNAME</I >", "pass"); 3 </PRE ></TD ></TR ></TABLE ><P ></P ></DIV ></P ><P > If you have character data with non-ASCII characters, you should make sure that <TT CLASS="envar" >NLS_LANG</TT > is set in your environment. For server modules, you should set it in the server's environment before starting the server.</P ><P > Returns a connection index on success, or false on failure. Details about the error can be retrieved using the <A HREF="function.ora-error.html" ><B CLASS="function" >ora_error()</B ></A > and <A HREF="function.ora-errorcode.html" ><B CLASS="function" >ora_errorcode()</B ></A > functions.</P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.ora-logoff.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="manual.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.ora-open.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Ora_Logoff</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.oracle.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Ora_Open</TD ></TR ></TABLE ></DIV ></BODY ></HTML >