Advanced Search
Search Results
135 total results found
Importing JSON into MySQL with PHP
Create a MySQL structure, import fictional JSON records with PHP and query the stored data.
Creating a Security Events Table
In this tutorial, you will create a MySQL table to store security event data imported from a JSON file. The JSON file contains homes, devices and events. Rather than storing the entire JSON structure, each event will be stored as a separate row in a database t...
Importing JSON into MySQL with PHP
This tutorial imports a fictional JSON dataset into MySQL using PHP, PDO, validation and a prepared statement. Use fictional data only. Do not import real student, staff, account, device or school-security information. Project files Create this structure insid...
Querying Imported Data with SQL
In this tutorial, you will use SQL queries to analyse the imported data. View All Events Open phpMyAdmin and select the: security_events table. Run: SELECT * FROM security_events; This displays all imported records. Count All Events To find the total number of...
Building a Security Dashboard Using PHP and MySQL
This standalone example queries fictional security-event data with PDO and presents useful summary and detail output. A dashboard is meaningful when each output answers a user question. Do not add a statistic or chart merely because it is easy to calculate. Co...
Working with JSON Data in JavaScript
Load, interpret and present nested fictional JSON data with JavaScript.
Loading JSON Data with JavaScript
In this tutorial, you will load data from a JSON file and display it on a webpage using JavaScript. The JSON file contains information about a smart home, including devices and security events. Create the Project Files Create a new folder called: json-demo Ins...
Displaying JSON Data in a Table
In this tutorial, you will display the device data in an HTML table using JavaScript. Current Project Structure Your project should contain: json-demo ├── index.html ├── script.js └── smart_security_data.json Create a Table Container Open: index.html Update th...
Displaying Nested Event Data from JSON
In this tutorial, you will work with nested JSON data by displaying the security events associated with each device. The JSON file contains devices, and each device contains its own list of events. Understanding the JSON Structure The JSON file contains: Home ...
Creating a Security Dashboard from JSON Data
In this tutorial, you will create a simple dashboard that summarises the data and highlights important security information. The dashboard will display: Total Devices Total Events Critical Events High Severity Events Medium Severity Events Using the sample JSO...
Working with APIs
Create PHP JSON APIs and retrieve database records through focused endpoints.
Creating a Simple JSON API with PHP
In this tutorial, you will create a simple API using PHP. The API will return JSON data when visited in a browser. This is the same type of data format used by many real-world APIs. Project Structure Create a folder called: api-demo Inside the folder place: ap...
Reading API Data with JavaScript
The API returns JSON data when visited in a browser. In this tutorial, you will use JavaScript to read data from the API and display it on a webpage. Project Structure Your project should contain: api-demo ├── api.php ├── index.html └── smart_security_data.jso...
Creating a Database-Driven API with PHP and MySQL
This tutorial creates a read-only JSON endpoint using PHP, PDO and fictional database records. An API should return only the data needed for its stated purpose. Do not expose password hashes, session data, personal information or unnecessary database fields. C...
Creating API Endpoints for Specific Data
Focused endpoints return the smallest useful result for a particular user need. This tutorial adds filtered and summary endpoints using PDO and fictional records. Endpoint for one severity Create api/events-by-severity.php: <?php declare(strict_types=1); requ...
HTML, CSS and JavaScript Basics
Standalone references for building structured, responsive and accessible web interfaces with HTML, CSS and supporting JavaScript.
HTML Reference
Standalone HTML references for structuring text, links, images, lists, tables, forms and embedded content.
HTML Text and Headings
HTML provides elements for displaying text, headings and page structure. Headings Headings are used to organise content on a webpage. HTML provides six heading levels. Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 Result: Heading 1 Heading 2 Head...