<!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>Contains the unique numeric error code of the last executed SAM operation.</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="samconnection.disconnect.html">SAMConnection::disconnect</a></div> <div class="next" style="text-align: right; float: right;"><a href="samconnection.error.html">SAMConnection::error</a></div> <div class="up"><a href="ref.sam.html">SAM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="samconnection.errno" class="refentry"> <div class="refnamediv"> <h1 class="refname">SAMConnection::errno</h1> <p class="verinfo">(PECL sam >= 0.1.0)</p><p class="refpurpose"><span class="refname">SAMConnection::errno</span> — <span class="dc-title">Contains the unique numeric error code of the last executed SAM operation.</span></p> </div> <div class="refsect1 description" id="refsect1-samconnection.errno-description"> <h3 class="title">Description</h3> <div class="fieldsynopsis"><span class="type">int</span> <var class="varname">$SAMConnection->errno</var>;</div> <p class="para"> Contains the numeric error code of the last executed SAM operation on this connection. If the last operation completed successfully this property contains 0. </p> </div> <div class="refsect1 returnvalues" id="refsect1-samconnection.errno-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> An integer greater than zero indicates the last error type encountered on the connection. Zero indicates that the last operation on this connection completed successfully. </p> </div> <div class="refsect1 examples" id="refsect1-samconnection.errno-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4521"> <p><strong>Example #1 Using the error number and description properties</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$conn </span><span style="color: #007700">= new </span><span style="color: #0000BB">SAMConnection</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$conn</span><span style="color: #007700">-></span><span style="color: #0000BB">connect</span><span style="color: #007700">(</span><span style="color: #0000BB">SAM_WMQ</span><span style="color: #007700">, array(</span><span style="color: #0000BB">SAM_HOST </span><span style="color: #007700">=> </span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">, </span><span style="color: #0000BB">SAM_PORT </span><span style="color: #007700">=> </span><span style="color: #0000BB">1506</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$msg </span><span style="color: #007700">= new </span><span style="color: #0000BB">SAMMessage</span><span style="color: #007700">(</span><span style="color: #DD0000">'This is a simple text item'</span><span style="color: #007700">);<br />if (!</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-></span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #DD0000">'topic://test'</span><span style="color: #007700">, </span><span style="color: #0000BB">$msg</span><span style="color: #007700">)) {<br /> </span><span style="color: #FF8000">// The Send failed!<br /> </span><span style="color: #007700">echo </span><span style="color: #DD0000">"Send failed (</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-></span><span style="color: #0000BB">errno</span><span style="color: #DD0000">) </span><span style="color: #0000BB">$conn</span><span style="color: #007700">-></span><span style="color: #0000BB">error</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-samconnection.errno-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="samconnection.error.html" class="xref">SAMConnection::error</a></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="samconnection.disconnect.html">SAMConnection::disconnect</a></div> <div class="next" style="text-align: right; float: right;"><a href="samconnection.error.html">SAMConnection::error</a></div> <div class="up"><a href="ref.sam.html">SAM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>