<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xml:id="function.mysql-thread-id" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysql_thread_id</refname> <refpurpose>Return the current thread ID</refpurpose> </refnamediv> <refsynopsisdiv> <warning> &mysql.alternative.note; <simplelist role="alternatives"> <member><function>mysqli_thread_id</function></member> </simplelist> </warning> </refsynopsisdiv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>int</type><methodname>mysql_thread_id</methodname> <methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter><initializer>NULL</initializer></methodparam> </methodsynopsis> <para> Retrieves the current thread ID. If the connection is lost, and a reconnect with <function>mysql_ping</function> is executed, the thread ID will change. This means only retrieve the thread ID when needed. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> &mysql.linkid.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The thread ID on success&return.falseforfailure;. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>mysql_thread_id</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); $thread_id = mysql_thread_id($link); if ($thread_id){ printf("current thread id is %d\n", $thread_id); } ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ current thread id is 73 ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>mysql_ping</function></member> <member><function>mysql_list_processes</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->