If you just want to grab one record, or know that you are only expecting one result you can use the following code: <?php // […]
Loop Through Recordset With MySQL and PHP (MYSQLI Connection)
This is the basic syntax required to loop through a MySQL table and output the results <?php // Connect to your database $conn = mysqli_connect(“localhost”, […]
Find An Element In A QueryString With JavaScipt
If you want to see if there’s a valid element in a querystring and then take an action you can use JavaScript to parse the […]
ON DELETE Cascade (Remove child records when parent records deleted)
If you haven’t created the child table you can run the following SQL command: CREATE TABLE ChildTable ( ChildID INT PRIMARY KEY AUTO_INCREMENT, ParentID INT, […]
Loop Through MySQL Fields And Output A Form
This script will loop though all fields in a database and output the name and create a form field with appropriate record value. This is […]
Yamtrack To WordPress Sync
If you’re a fan of films and TV you’ll probably keep track of what you’re watching. While there are online services such as Trakt and […]
Add Canonical And Open Graph Tags To WordPress
Add the following function into your theme’s functions.php file or as a standalone plugin. This code will remove any existing WordPress canonical tags and replace […]
Responsive Navigation Menu With Mobile “Hamburger” Button
The following code will provide a navigation bar that collapses on Mobile view. <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>Responsive […]
CSS UL Li Styling
<style> main ul li a { display: block; padding: 15px 20px; margin-bottom: 10px; text-decoration: none; border-radius: 20px; /* Pill shape */ transform: scale(1); transition: background-color […]
Basic CSS Template
/* Basic CSS Reset to help with cross-browser consistency Learn more: https://meyerweb.com/eric/tools/css/reset/ */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, […]