· 8 years ago · Mar 06, 2018, 09:26 AM
1SQL
2CREATE DATABASE IF NOT EXISTS `rorschachdb`
3USE `rorschachdb`;
4
5CREATE TABLE IF NOT EXISTS `rorschach` (
6 `ID` int(11) NOT NULL AUTO_INCREMENT,
7 `Date` text,
8 `Time` text,
9 PRIMARY KEY (`ID`)
10) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=latin1;
11
12
13PHP FILE
14<?php
15$con=mysqli_connect("ip","user","pass","db");
16if (mysqli_connect_errno())
17{
18echo "Failed to connect to MySQL: " . mysqli_connect_error();
19}
20
21$result = mysqli_query($con,"SELECT * FROM Rorschach");
22
23echo "<table border='1'>
24<tr>
25<th>Number</th>
26<th>Date</th>
27<th>Time</th>
28</tr>";
29
30while($row = mysqli_fetch_array($result))
31{
32echo "<tr>";
33echo "<td>" . $row['ID'] . "</td>";
34echo "<td>" . $row['Date'] . "</td>";
35echo "<td>" . $row['Time'] . "</td>";
36echo "</tr>";
37}
38echo "</table>";
39
40mysqli_close($con);
41?>