Booleans in JavaScript

A really important part of programming is being able to compare values in order to make decisions in code. Very often, in programming, you will need a data type that can only have one of two values, like YES / NO ON / OFF TRUE / FALSE When a comparison is made the outcome is…

Read More

Strings in JavaScript

What are Strings? Simply put – anything you can type from the keyboard! Strings are treated as text or a sequence of characters. Characters can include: Letters: a-z and A-Z Numbers: 0-9 Spaces Special characters like underscores, dashes, asterisks and more Only thing that is tricky? Single and double quotes. We’ll talk about that. Basically…

Read More

Numbers in JavaScript

Numbers are just that – numbers.  Things like 1 or 100 or 5/12 or 26.5.  In JavaScript all numbers – whether integers (whole numbers) or float (decimals) are stored in the same type. This is how you store numbers in variables. var number1= 16; var number2= 18.50; Math Operators Mathematical symbols are called operators in…

Read More

Basic Syntax

Before we dive into how to do things in JavaScript – let’s go over some of the basic syntax. What is syntax? Syntax is what grammar is to speaking a language. It tells you how to structure a sentence, what kind of punctuation to use, when to capitalize and things like that. Every programming language…

Read More

Updating, Inserting and Deleting Data with PHP

You know how to get data from your database…but one of the great powers of PHP is letting the user update, add and remove information.  First, let’s go over the basic syntax for doing this in SQL.  If you need to review the SQL – here’s the section on how to add, update or delete…

Read More

Getting Data From Database

1. Connect Now that we know how to connect to a database, we can get data out of it.  The first step is from the lesson before….connect to the database. <?php //set up connection variables $servername = ‘localhost’; $username = ‘mscoding_members’; $pwd = ‘nottelling’; $dbname = ‘mscoding_members’; //connect! $conn= new mysqli($servername,$username, $pwd, $dbname); //Check to…

Read More

Input in JavaScript

First, what exactly is input? Just like output is giving or displaying information to the user, input is getting information from the user. There are many ways to do this in JavaScript but right now we’ll learn how using two popup windows: the confirm box and the prompt box. The Prompt Box This is used…

Read More

Output in JavaScript

There are no built in print or display functions in JavaScript like there are in other languages. So, how do you display information to the user? There are two basic methods that we will earn today: alert() document.write() The alert() function We used this in our Hello World example.  This creates a popup box that…

Read More

Hello World

The most common computer program and the one you will likely write over and over if you go on to more coding is the Hello World program. What does it do?  It simply says hi. Let’s see how it would look in JavaScript. What’s going on here? First, we create an HTML file as we…

Read More