-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfields.php
More file actions
146 lines (99 loc) · 3.46 KB
/
Copy pathfields.php
File metadata and controls
146 lines (99 loc) · 3.46 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<title>Client</title>
<style>
.dev {
border: solid 2px green;
}
.devr {
/* border: solid 2px red;*/
}
a {
color: blue;
}
</style>
</head>
<body>
<div class="container">
<div class="pt-5 row align-items-center">
<div class="col-8 offset-2 text-center">
<h1>Fields</h1>
</div>
</div>
<div class="pt-5 row">
<div class="col-lg-2 col-4">
<h3>Client</h3>
<?php describe("Client") ?>
</div>
<div class="col-lg-2 col-4">
<h3>Vehicle</h3>
<?php describe("Vehicle") ?>
</div>
<div class="col-lg-2 col-4">
<h3>Service</h3>
<?php describe("Service") ?>
</div>
<div class="col-lg-2 col-4">
<h3>Branch</h3>
<?php describe("Branch") ?>
</div>
<div class="col-lg-2 col-4">
<h3>Supplier</h3>
<?php describe("Supplier") ?>
</div>
<div class="col-lg-2 col-4">
<h3>Staff</h3>
<?php describe("Staff") ?>
</div>
</div>
<div class="pt-5 row">
<div class="col-lg-2 col-4">
<h3>PartType</h3>
<?php describe("PartType") ?>
</div>
<div class="col-lg-2 col-4">
<h3>PartRequest</h3>
<?php describe("PartRequest") ?>
</div>
<div class="col-lg-2 col-4">
<h3>Stock</h3>
<?php describe("Stock") ?>
</div>
<div class="col-lg-2 col-4">
<h3>PartInstance</h3>
<?php describe("PartInstance") ?>
</div>
<div class="col-lg-2 col-4">
<h3>Supplier_PartType</h3>
<?php describe("Supplier_PartType") ?>
</div>
</div>
<div hidden class="pt-5 row">
<div class="col-lg-2 col-4">
<h3>Stock</h3>
<?php describe("Stock") ?>
</div>
</div>
</div>
<!-- Usage of this file -->
<?php // include 'simple-read.php';?>
<!-- ------------------ -->
<?php
function describe($table){
$con=mysqli_connect("silva.computing.dundee.ac.uk","19ac3u18","a1bc23","19ac3d18");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// Perform queries
$result = mysqli_query($con,"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '19ac3d18' AND TABLE_NAME = '" . $table . "';");
//mysqli_query($con,"INSERT INTO Persons (FirstName,LastName,Age) VALUES ('Glenn','Quagmire',33)");
while ($row = $result->fetch_assoc()) {
//echo $row['Address']."<br>";
echo $row['COLUMN_NAME'] . '<br>';
}
mysqli_close($con);
}
?>
</body>