· 9 years ago · Apr 11, 2017, 03:22 AM
1?php
2 $username = 'root';
3 $password = '';
4 $db = 'angel';
5 $host = 'localhost';
6
7
8 $mysqli = new mysqli($host, $username, $password, $db);
9
10 if ($mysqli->connect_errno) {
11 printf("Connect failed: %s\n", $mysqli->connect_error);
12 exit();
13 }
14
15 $form_table =
16 "CREATE TABLE IF NOT EXISTS form {
17 ID bigint(20) UNSIGNED AUTO_INCREMENNT,
18 post_firstname varchar(20) NOT NULL,
19 post_lastname varchar(20) NOT NULL,
20 post_email varchar(64) NOT NULL,
21 post_phone int(10),
22 post_date datetime NOT NULL,
23 PRIMARY KEY(ID)
24 }";
25
26 if ($mysqli->query($form_table) === TRUE) {
27 printf("Table form successfully created.\n");
28 }
29
30?>