· 8 years ago · Jun 05, 2018, 04:32 PM
1#Coding first.php (need to be updated)(st,et,ip,loc,date,submit)
2
3<html>
4<body>
5 <title> Pcap Pulling Automation </title>
6 <h1> Pcap Request <h1>
7
8<form method="post" action="">
9 Start time: <input type="text" name="st"><br>
10 End time: <input type="text" name="et"><br>
11 IP Address: <input type="text" name="ip" value = "Eg:10.0.0.125"><br>
12 Location: <select name="loc">
13 <option>9a</option>
14 <option>9b</option>
15 <option>9c</option>
16 <option>9d</option>
17 <option>9e</option>
18 </select><br>
19 date:<input type="date" id="datepicker" name='from' size='9' value="" /><br>
20 <input type="submit" name="sub" value="Submit">
21</form>
22<?php
23
24?>
25</html>
26</body>
27
28#Creating and Manage Databases in MySQL and MariaDB
29CREATE DATABASE pcapinfo;
30
31Query OK, 1 row affected (0.00 sec)
32
33#Viewing Databases
34SHOW DATABASES;
35
36+--------------------+
37| Database |
38+--------------------+
39| information_schema |
40| mysql |
41| new |
42| newdb |
43| pcapinfo |
44| performance_schema |
45| phpmyadmin |
46| testing1 |
47+--------------------+
488 rows in set (0.00 sec)
49
50#Find out which database is currently selected
51SELECT database();
52
53+------------+
54| database() |
55+------------+
56| NULL |
57+------------+
581 row in set (0.01 sec)
59
60#Changing Databases
61USE new_database;
62
63Database changed
64
65#We can see that the database has been selected by re-issuing the command we ran previously:
66
67SELECT database();
68
69+--------------+
70| database() |
71+--------------+
72| new_database |
73+--------------+
741 row in set (0.00 sec)
75
76#Delete a Database
77
78DROP DATABASE new_database;
79
80Query OK, 0 rows affected (0.00 sec)
81
82#Creating a table
83
84CREATE TABLE IF NOT EXISTS info (
85 st int(5) NOT NULL,
86 et int(5) NOT NULL,
87 ip int(5) NOT NULL,
88 loc varchar(20) DEFAULT NULL
89 );
90
91Query OK, 0 rows affected (0.03 sec)
92
93#Defining Columns
94show columns in info;
95
96+-------+-------------+------+-----+---------+-------+
97| Field | Type | Null | Key | Default | Extra |
98+-------+-------------+------+-----+---------+-------+
99| st | int(5) | NO | | NULL | |
100| et | int(5) | NO | | NULL | |
101| ip | int(5) | NO | | NULL | |
102| loc | varchar(20) | NO | | NULL | |
103+-------+-------------+------+-----+---------+-------+
1044 rows in set (0.00 sec)
105
106
107#Inserting Data
108syntax:
109
110INSERT INTO table_name (field1, field2, ...) VALUES (value1, value2, ...);
111
112INSERT INTO info (st, et, ip, loc)
113VALUES
114(11, 12, 15, "del");
115
116
117#To see the information, query the table. The asterisk (*) is a special wildcard character that matches everything.
118 SELECT * FROM info;
119
120+----+----+----+---------+
121| st | et | ip | loc |
122+----+----+----+---------+
123| 11 | 12 | 10 | chennai |
124| 11 | 12 | 15 | del |
125+----+----+----+---------+
1262 rows in set (0.00 sec)
127
128#Deleting a table
129
130DROP TABLE table_name;