-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbible.php
More file actions
62 lines (57 loc) · 1.52 KB
/
bible.php
File metadata and controls
62 lines (57 loc) · 1.52 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?PHP
//MYSQL Database 1 (For events)
$dbusername1 = "cakephpspencer";
$dbpassword1 = "JESUSsaves!777";
$hostname1 = "cakephpspencer.db.7228669.hostedresource.com";
$dbname1 = "cakephpspencer";
$link1 = mysql_connect($hostname1,$dbusername1 ,$dbpassword1) or die('Cannot connect to the DB');
mysql_select_db("cakephpspencer");
$sql="CREATE TABLE `bible` (
`id` int(11) NOT NULL auto_increment,
`ref` varchar(100) NOT NULL,
`book` varchar(100) NOT NULL,
`chapter` int(10) NOT NULL,
`verse` int(10) NOT NULL,
`text` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";
$x= mysql_query($sql);
$y = set_time_limit(0);
print(str_repeat(" ", 300) . "\n");
flush(); // Flush all output to make sure
?>
<html>
<head><title>1611 KJV Bible</title></head>
<body>
<table>
<?PHP
$bible = simplexml_load_file('kjv_osis.xml');
//print_r($bible);
for($d=0; $d<66; $d++){
echo $d."<br>";
for($c=0; $c<160; $c++){
for($v=0; $v<100; $v++){
$x = $bible->osisText[0]->div[$d]->chapter[$c]->verse[$v];
if ($x==NULL || $x=="" || $x==" "){
continue;
}else{
?>
<!-- <tr><td><?PHP $r= $x["osisID"]; //echo $r; ?></td><td><?PHP //echo $x ?></td></tr> !-->
<?
$o = explode(".",$r);
$sql="INSERT INTO bible ( `id` ,`ref` ,`book`,`chapter`,`verse`,`text`) VALUES ('NULL', '{$r}','{$o[0]}','{$o[1]}','{$o[2]}', '{$x}');";
$result = mysql_query($sql);
}
}
if ($x==NULL || $x=="" || $x==" "){
continue;
}
}
if($x==NULL){
continue;
}
}
?>
</table>
</body>
</html>