Home Red Wooden Vehicles or Plastic Toys Yellow Plastic Toys From $10 to $20 Stuffed Animals or Wooden Toys Under $10 Made in USA Robots or Yellow Vehicles Non Vehicle Plastic Toys From $10 to $20 All Products Store Home Page

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


Green Plastic Tractor
This green plastic tractor may be pushed around on the floor. Made in USA.
Sale Price $4.95
Retail $9.95
Buy Now!


Red Plastic Barn
This plastic barn is realistic. Stands 2 ft tall. Imported. Made in USA.
Sale Price $23.95
Retail $28.95
Buy Now!


--Page 1 of 1--

----

 

 

 

 

 

 

Copyright 2012, Michael Sakowski and His Licensors
News on My Blog! Share Your Ideas! Copyright Info Suggested Uses Links Contact FAQs