Home » Articles by: Brad Morton

How to Use the PHP echo Statement, With Examples

PHP echo

This quick tutorial will show you how to use the PHP echo statement to print/display information on screen. A computer program isn’t much good if it doesn’t display some output to the user. The echo statement prints a simple string of text in PHP – usually to the web browser. Syntax echo is a simple statement with a simple purpose – and it has simple syntax: echo expressions Note that: expressions should be one or more strings containing the text or characters you want to display on screen If more than … Read more

Categories PHP

Home » Articles by: Brad Morton

Limit Column Values With The MySQL CHECK Constraint [Examples]

MySQL CHECK CONSTRAINT

This article will demonstrate the usage of the SQL CHECK Constraint to limit column values, as used in MySQL/MariaDB. The SQL CHECK constraint allows you to define limitations to the value which can appear in a table column. It also allows you to apply constraints to a whole table, letting you restrict a column’s values based on the values of other columns in the table row. This behavior is useful for making sure you are only getting valid data inserted into your database. For example, you might … Read more

Home » Articles by: Brad Morton

Default MySQL/MariaDB Port, Finding It, Changing It

Changing the MySQL Port

This article will show you how to find the default or current MySQL (or MariaDB) port and how to change it. What is a Port? A port is a numerical identifier for a communication endpoint on a computer network. Or, put simpler, it’s a unique number on your computer that points to a specific program that is running so that other programs can connect to it. MySQL/Maria DB, being networked database services, expose themselves to other computers via a configured port, allowing other computers to connect to and … Read more

Home » Articles by: Brad Morton

How to Use the which Command in Linux, With Examples

Linux which Command

This tutorial will teach you how to use the which command in Linux with some simple examples. The which command will tell you the path to the executable used by a command on the system if it exists. Why is this useful? Say you’ve got two copies of the MySQL executable installed on your system (installed via different means), and you want to know which one is actually in use so that the other can be removed – the which command can tell you which of the two is called when you execute MySQL on … Read more

Home » Articles by: Brad Morton

How to Set/Change the Date/Time in Linux

Linux set time

This simple tutorial will show you how to view, set, or update the time and date on your Linux system. You may also want to check out our article on changing the timezone in Linux. Find out the Current Time and Date Before you change the time and date, it’s worth checking what it’s currently set to – it may already be correct! The following command will display information about the time and timezone as it is currently set on your system: timedatectl The returned … Read more

Home » Articles by: Brad Morton

Beginners Guide: Create and Use JavaScript ES6 Modules

JavaScript Modules

This short tutorial aims to get you started creating and using JavaScript modules and provides some simple examples. What is ES6? JavaScript’s official name is actually ECMAScript, and version 6 introduced module functionality to create and consume modules, so you might see JavaScript Modules referred to as ES6 or ES2015 Modules. What is a JavaScript Module? As you get more adventurous with your JavaScript programming projects and your code becomes more complex, it might start to become harder to manage. One way of mitigating this is splitting … Read more

Home » Articles by: Brad Morton

How to Set/Change the Timezone in Linux

Linux set timezone

This simple tutorial will show you how to view, set, or update the timezone on your Linux system. You may also want to check out our article on changing the date/time in Linux. Find out the Current Timezone Before you change the timezone, it’s worth checking what it’s currently set to – it may already be correct! The following command will display information about the time and timezone as it is currently set on your system: timedatectl The returned information will look something like this: … Read more

Home » Articles by: Brad Morton

Guide to Renaming Multiple Files in Linux

Linux rename multiple files

This guide will show you how to rename multiple files in Linux – renaming files sequentially, changing the extension, adding the date, and other renaming tasks. We’ve already covered moving and renaming files and directories using the mv command. However, renaming multiple files at once is a bit more complex. While it can be done with the mv command, some tools are built specifically for the task. Read on to find out what those tools are and how they can be used. Each tool has differences in how the renaming … Read more

Home » Articles by: Brad Morton

Converting Variable Types in Python, Howto, With Examples

Python Type Conversion

This article will show you how to use Python’s built-in variable conversion functions, with examples. A variable’s type determines what kind of data it can store and what can be done with it. For example, string typed variables contain sequences of characters that can be joined and split (think words and sentences). In contrast, numeric typed variables contain numeric values intended to be used in calculations. Being able to convert a variable’s type allows data to be used in different ways. Converting a Variable to a … Read more

Home » Articles by: Brad Morton

Print an Array in PHP using print_r and var_dump, With Examples

PHP Print Array

This article will show you several methods on how to print an array in PHP, with some examples. Arrays in PHP can be processed using foreach loops to interact with each element in the array. This article focuses on directly printing an array in full rather than each element individually. Using echo to Print an Array (It Won’t Work) You might think that you can just use the echo statement to print an array in PHP – this is not the case, as seen below: <?php // Define an … Read more

Categories PHP