<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Open mSQL connection</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.msql-close.html">msql_close</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.msql-create-db.html">msql_create_db</a></div> <div class="up"><a href="ref.msql.html">mSQL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.msql-connect" class="refentry"> <div class="refnamediv"> <h1 class="refname">msql_connect</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">msql_connect</span> — <span class="dc-title">Open mSQL connection</span></p> </div> <div class="refsect1 description" id="refsect1-function.msql-connect-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><strong>msql_connect</strong></span> ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$hostname</code></span> ] )</div> <p class="para rdfs-comment"> <span class="function"><strong>msql_connect()</strong></span> establishes a connection to a mSQL server. </p> <p class="para"> If a second call is made to <span class="function"><strong>msql_connect()</strong></span> with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. </p> <p class="para"> The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling <span class="function"><a href="function.msql-close.html" class="function">msql_close()</a></span>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.msql-connect-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">hostname</code></em></span> <dd> <p class="para"> The hostname can also include a port number. e.g. <em>hostname,port</em>. </p> <p class="para"> If not specified, the connection is established by the means of a Unix domain socket, being then more efficient then a localhost TCP socket connection. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> While this function will accept a colon (<em>:</em>) as a host/port separator, a comma (<em>,</em>) is the preferred method. </p> </p></blockquote> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.msql-connect-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a positive mSQL link identifier on success, or <strong><code>FALSE</code></strong> on error. </p> </div> <div class="refsect1 seealso" id="refsect1-function.msql-connect-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.msql-pconnect.html" class="function" rel="rdfs-seeAlso">msql_pconnect()</a> - Open persistent mSQL connection</span></li> <li class="member"> <span class="function"><a href="function.msql-close.html" class="function" rel="rdfs-seeAlso">msql_close()</a> - Close mSQL connection</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.msql-close.html">msql_close</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.msql-create-db.html">msql_create_db</a></div> <div class="up"><a href="ref.msql.html">mSQL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>