Documentation TYPO3 par Ameos

testgenid.php

00001 <?php
00002 /*
00003         V4.50 6 July 2004 
00004         
00005         Run multiple copies of this php script at the same time
00006         to test unique generation of id's in multiuser mode
00007 */
00008 include_once('../adodb.inc.php');
00009 $testaccess = true;
00010 include_once('testdatabases.inc.php');
00011 
00012 function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
00013 {
00014         $table = 'adodbseq';
00015         
00016         $db->Execute("drop table $table");
00017         //$db->debug=true;
00018         
00019         $ctr = 5000;
00020         $lastnum = 0;
00021         
00022         while (--$ctr >= 0) {
00023                 $num = $db->GenID($table);
00024                 if ($num === false) {   
00025                         print "GenID returned false";
00026                         break;
00027                 }
00028                 if ($lastnum + 1 == $num) print " $num ";
00029                 else {
00030                         print " <font color=red>$num</font> ";
00031                         flush();
00032                 }
00033                 $lastnum = $num;
00034         }
00035 }
00036 ?>


Généré par Les experts TYPO3 avec  doxygen 1.4.6