Query: maxdb_ping
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MAXDB_PING(3) 1 MAXDB_PING(3) maxdb_ping - Pings a server connection, or tries to reconnect if the connection has gone down Procedural styleSYNOPSISbool maxdb_ping (resource $link)DESCRIPTIONObject oriented style bool maxdb::ping (void ) Checks whether the connection to the server is working. If it has gone down, and global option maxdb.reconnect is enabled an automatic reconnection is attempted. This function can be used by clients that remain idle for a long while, to check whether the server has closed the connection and recon- nect if necessary.RETURN VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } /* check if server is alive */ if ($maxdb->ping()) { printf ("Our connection is ok! "); } else { printf ("Error: %s ", $maxdb->error); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } /* check if server is alive */ if (maxdb_ping($link)) { printf ("Our connection is ok! "); } else { printf ("Error: %s ", maxdb_error($link)); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: Our connection is ok! PHP Documentation Group MAXDB_PING(3)
Related Man Pages |
---|
maxdb_stat(3) - php |
maxdb_character_set_name(3) - php |
maxdb_kill(3) - php |
maxdb_multi_query(3) - php |
maxdb_thread_id(3) - php |
Similar Topics in the Unix Linux Community |
---|
Testing connection with a script |
FTP error |
NDM: Source file open failed. Error= 2 |
Ssh to Solaris 10 server - close connection |
/etc/rc2.d/ check if kerberos server is enabled in the log or not |