-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
26 lines (23 loc) · 1.75 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
$dbh = new PDO('sqlite:sudoku.sqlite');
$dbh->beginTransaction();
$dbh->exec('CREATE TABLE "sudoku" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,"sudoku" TEXT)');
$s=$dbh->prepare('insert into sudoku (sudoku) values (?)');
$s->execute(array("850002400720000009004000000000107002305000900040000000000080070017000000000036040"));
$s->execute(array("100007090030020008009600500005300900010080002600004000300000010040000007007000300"));
$s->execute(array("005300000800000020070010500400005300010070006003200080060500009004000030000009700"));
$s->execute(array("070008000001000004002400500080030007005200400900000080009006100700000300000100040"));
$s->execute(array("300900000007600400040000006006001500010400080005000700700000030008005200000003004"));
$s->execute(array("090600800003000060007900000010000070900003004080400020000002300060000200005008000"));
$s->execute(array("040200800001000900600004000006010070100020004070000300000700003008000200005003090"));
$s->execute(array("500090000006000040009300070020003050001020900040000030060008100070000300000010006"));
$s->execute(array("040000000900008400200001300030800070006000100010005040008700006003200007000000090"));
$s->execute(array("056000000100700200000092000014080000800000009000040350000530000009008002000000160"));
$s->execute(array("007300200300000001800620000073400005000000000500008490000067004200000006009004300"));
$s->execute(array("400000000090002500008300100070090006500000003900200040006008200007600090000000007"));
$s->execute(array("400000005020070900010600000090010002060000010200007030000009080003050020800000006"));
$array=file("http://mapleta.maths.uwa.edu.au/~gordon/sudoku17",FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
for($i=0;$array[$i];$i++){
$s->execute(array($array[$i]));
}
$dbh->commit();