source: branches/beta/html/test/uehara/lock1.php @ 14937

Revision 14937, 593 bytes checked in by uehara, 15 years ago (diff)
Line 
1<?php
2require_once("../../require.php");
3
4$objQuery = new SC_Query();
5
6// ¥í¥Ã¥¯¤¹¤ë
7$objQuery->query('LOCK TABLES dtb_order WRITE');
8
9for($i=0; $i < 5; $i++) {
10    sleep(3);
11}
12
13// ¼¡¤ÎIncrement¤ò¼èÆÀ
14$arrRet = $objQuery->getAll("SHOW TABLE STATUS LIKE ?", array('dtb_order'));
15$auto_inc_no = $arrRet[0]["Auto_increment"];
16
17echo $auto_inc_no;
18
19
20// Ãͤò¥«¥¦¥ó¥È¥¢¥Ã¥×¤·¤Æ¤ª¤¯
21//$objQuery->conn->query("ALTER TABLE dtb_order AUTO_INCREMENT=?" , $auto_inc_no + 1);
22
23
24for($i=0; $i < 5; $i++) {
25    sleep(3);
26}
27
28// ¥í¥Ã¥¯²ò½ü
29$objQuery->query('UNLOCK TABLES');
30
31
32?>
Note: See TracBrowser for help on using the repository browser.