(PECL mysqlnd_ms >= 1.2.0)
mysqlnd_ms_get_last_gtid — ��������ȫ��ͬ�� ID (GTID)
�������һ��д�����Ժ�� GTID���������ܱ�֤һ�����Ǵ�д���������� GTID�����ǵõ��� GTID һ�������д���������� GTID ��
�ɹ����� GTID��ʧ�ܷ��� FALSE
��
����ͨ�������ļ��� global_transaction_id_injection �½ڶ���� fetch_last_gtid ��������ȡ GTID��
�ں������õ�ʱ��GTID �����Ѿ������ˡ�
Note:
������Ҫ PHP >= 5.4.0 �汾��PECL/mysqlnd_ms >= 1.2.0 �汾���� PHP 5.3 �汾�� mysqlnd �ⲻ��ʹ�á�
Example #1 mysqlnd_ms_get_last_gtid() example
<?php
/* Open mysqlnd_ms connection using mysqli, PDO_MySQL or mysql extension */
$mysqli = new mysqli("myapp", "username", "password", "database");
if (!$mysqli)
/* Of course, your error handling is nicer... */
die(sprintf("[%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()));
/* auto commit mode, transaction on master, GTID must be incremented */
if (!$mysqli->query("DROP TABLE IF EXISTS test"))
die(sprintf("[%d] %s\n", $mysqli->errno, $mysqli->error));
printf("GTID after transaction %s\n", mysqlnd_ms_get_last_gtid($mysqli));
/* auto commit mode, transaction on master, GTID must be incremented */
if (!$mysqli->query("CREATE TABLE test(id INT)"))
die(sprintf("[%d] %s\n", $mysqli->errno, $mysqli->error));
printf("GTID after transaction %s\n", mysqlnd_ms_get_last_gtid($mysqli));
?>