#!/usr/bin/perl
###############################################
##           Version 04.05.99                ##
###############################################
##   (c)1997 Daevid Vincent                  ##
## Unauthorized use of this code is strictly ##
## prohibited and subject to criminal        ##
## prosecution and or death                  ##
###############################################
##         Pounds on mySQL database          ##
###############################################

$default_db_name  = "wt_client";

	use Mysql;
	require 'ctime.pl';
	
	srand(time ^ $$);
	#$num = rand(4000); # Pick a Random Number

	($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
	$mon++;
	# $today = sprintf "%02d:%02d %02d/%02d/%02d",$hour,$min,++$mon,$mday,$year;

	$dbh = Mysql->Connect("localhost",$default_db_name) or die "Error Connecting to $default_db_name: $Mysql::db_errstr<BR>\n";
	$dbh->SelectDB($default_db_name);

	for ($i = 1; $i < 10000; $i++) {
		#$guid = "9324-342nvg09w3f48-w40934";
		$guid = sprintf "%04d-%013d-%06d",rand($i),$sec*rand(1000000),rand(4000)*rand($i);
		#$guid = rand()."-".$sec*rand()."-".rand(4000)*rand($i);
		$sth = $dbh->Query ( "insert into Player_Table values 
								(0,'$guid','BETA-$i                      ','1.69', 1,
								'Windows 98','4.10  Build 1998','AMD K6 MMX','350','128',
								'RAGE PRO TURBO AGP 2X (English)','ATI Tech. - Enhanced','Mach64: RagePro','8',
								'TBS Montego Wave Audio','asp4wave.drv','4.00.00.0000 \"4.05.112c\"  English Beta Retail',
								'4.04.00.0068','4.06.00.0318','4.06.00.0318','4.06.00.0318','4.06.00.0318',
								'IE12345','NS12345','OB54321',
								null)"
						 	)
		 	and sprintf "[%05d] inserting into table (guid: $s)\n",$i,$guid
		 	or die "Error inserting into table: $Mysql::db_errstr\n";
	}
#	$sth = $dbh->Query ( "LOAD DATA INFILE '$filename' REPLACE INTO TABLE CD_Table FIELDS OPTIONALLY ENCLOSED BY '\"'" )
#	 	and print "Loading $filename into $default_db_name CD_Table\n"
#	 	or die "Error Loading TSV into $default_db_name CD_Table: $Mysql::db_errstr\n";

	
#	$sth = $dbh->Query ( "SELECT * FROM CD_Table" )
#	 	and print "Querying $default_db_name CD_Table\n"
#	 	or die "Error Querying $default_db_name CD_Table: $Mysql::db_errstr\n";
	
