annotate interface/add_missing_books_to_sections.php @ 3:f196939ccc03

error handle and alert feedback to user. If error occurs, user'll not be halted by the loading page and sections_revisions will recovery to previous version.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 26 Jan 2015 12:19:39 +0100
parents da5309d54083
children 883ad980a43b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
2 include_once('Lib_mb_utf8.php');
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 include_once('config.php');
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
4 include_once('edit_section_db.php');
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 set_time_limit(0);
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
6 ini_set('memory_limit', '-1');
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
7
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
8 $link_mysql = mysql_connect($mysql_server, $mysql_user, $mysql_password);
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
9 mysql_query("SET NAMES utf8");
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
10
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
11 if (!$link_mysql) {
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
12 die('Could not connect: ' . mysql_error());
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
13 }
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
14
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
15 $db_selected = mysql_select_db($mysql_database, $link_mysql);
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 if (!$db_selected) {
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
17 die ('Can\'t use foo : ' . mysql_error());
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 }
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
19 ?>
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
20
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
22 <html>
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 <head
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
24 </head>
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 <body>
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
26 <?php
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 add_missing_books_to_sections();
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
28
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
29 ?>
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
30 </body>
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
31
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
32
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
33 </html>
da5309d54083 add missing books to sections as dummy entries for further modification.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
34