Welcome To The Math Motivation Demo Toy Store!

The logic problems demonstrated using this store illustrate how logic is used in real world applications.

Background on This Demo Store

  • There are 24 items, each item containing a record in a MySQL database. A screenshot of part of this database is shown here.  Click on All Products to see the fields for each of the items. More info on MySQL is given here.
     
  • The pages on this section of the site ending with extension  .php (including the page your are viewing) use what is called PHP programming language. The PHP pages contain code on them that the web server reads and then performs actions based on the code. In this case, the server places products on the page from the MySQL database.  More info on PHP is given here.
     
  • Within the extensive PHP code (here is a screenshot of part of it), there is what is called a SELECT statement that uses a WHERE command.  The WHERE command is the equivalent of an IF-THEN statement.  The pages linked to in the top menu of this demo-store illustrate how we use mathematical logic in this SELECT statement.

An Example: Display All Plastic Toys Made in USA
The code in the SELECT section of the PHP code along with  its equivalent IF-THEN statement, followed by displayed results, is shown below.

We are using the IF-THEN statement:
IF the Name record contains the word "plastic" and the Description record contains the word "USA", THEN display the product.

The PHP code used to execute this IF-THEN statement is:

AND HERE ARE THE DISPLAYED PRODUCTS