PHP/MySQL Query

                          Exercise: PHP/MySQL Query

Given:  Table Name      Column Name     Data Type     Length  Comment
        ----------      -----------     ---------     ------  ----------  
        Item:           id              int                5  primary key,
                        name            varchar           15
                        cost            decimal            5  2 dec. places
                        qty             int                1
  
Prepare then invoke a php program to query and print MySQL Item data.
1. Assign to the variable $db the value returned from instantiating a new 
   database object with parameters for host (e.g. "localhost"), userName,
   password, and database(schema) name.

2. Define a variable named $sql to be assigned a string for a SQL select
   statement to retrieve the nonKey columns for the row with id value 20625.   


3. To execute, call mysqli_query( ) passing it $db and $sql and assign the
   return value to $result.   


4. Then invoke the function mysqli_fetch_array() with $result as an actual
   parameter(argument) and assign to $column, a php array variable, the row 
   values returned. For the Item table, $column would be assigned elements 
   corresponding to id, name, cost and quantity. Reference elements by 
   associative or numeric indexes.

   
5. Output those values: echo $str, print($str), fwrite($fp,$str).


6. Modify step 2 to select all columns from all rows then repeat step 3.


7. Prepare a while statement to repeat as long as values are returned from 
   a call to mysqli_fetch_array() as in step 4. During each iteration,
   output the column values.





   
   
8. Invoke mysqli_close($db) to close the database connection.
 
 
item.csv:
04505,Noodle Cutter,18.95,6
12016,Garlic Press,13.95,9
15303,Coffee Maker,16.95,6
16344,Nut Cracker,69.00,4
20625,Potato Stomper,2.95,8
22760,Butter Melter,4.95,6
23316,Cheese Press,209.00,1
31102,Copper Kettle,69.00,3
36103,Pepper Grinder,27.50,4
69206,IceCream Maker,199.00,6