-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.php
51 lines (37 loc) · 1.07 KB
/
testing.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
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
<?php
include('includes/config.php');
$a_fisrt = array();
$char_suffix = array("a", "b", "c", "d");
for ($i=1; $i < 14; $i++) {
if ($i<=9) {
for ($j=0; $j < 4; $j++) {
$suf = $char_suffix[$j % count($char_suffix)];
$room = "A40$i$suf ";
array_push($a_fisrt, $room);
echo $room;
$query="insert into new_daniel_hall_a(room_no) values(?)";
$stmt = $mysqli->prepare($query);
$rc=$stmt->bind_param('s',$room);
$stmt->execute();
}
}
else {
for ($j=0; $j < 4; $j++) {
$suf = $char_suffix[$j % count($char_suffix)];
$room = "A4$i$suf ";
array_push($a_fisrt, $room);
echo $room;
$query="insert into new_daniel_hall_a(room_no) values(?)";
$stmt = $mysqli->prepare($query);
$rc=$stmt->bind_param('s',$room);
$stmt->execute();
}
}
}
//echo(count($a_fisrt));
//$room_no = 0;
//$query="insert into room_count (count) values(?)";
//$stmt = $mysqli->prepare($query);
//$rc=$stmt->bind_param('i',$room_no);
//$stmt->execute();
?>