Test on Wed. March 30 (continued Apr. 1?) covering material up to Spring Break. New material includes classes and
objects, files (JSON, XML, CSV), and making graphic images from PHP.
MakeTable_StateCapital.zip Makes an HTML table from results
of a database select statement (uses FETCH_NUM).
MakeStateCapitalTable_2.zip Same as above but uses
FETCH_ASSOC and a DESCRIBE statement to make table headers.
StateCapitalFetchAllFETCH_OBJ_JSON_Encode.zip
fetches the results of a query all at once instead of record-by-record, makes objects out of the records, converts those
objects into the corresponding JSON (JavaScript Object Notation)
StateCapitalInfoFromAbbr.zip Shows a prepared, parametrized
query. Uses the GET method to allow the user to supply the parameter value (a state abbreviation). Results displayed
as JSON
Wednesday:
Labs
Lab: Product Select Make a PHP page that has a drop-down select populated by a northwind query with the ProductName displaying to
the user and the ProductID serving and the option's value. Put your credentials in an included file as shown in the
examples; I should be able to swap my credential file for yours and run your code without needing other changes.
Lab: "Product API" Make a page (possibly the previous page) with a form that allows the user to enter a ProductID then use the GET
method and a "prepared, parametrized" query to output the data for that product in JSON format.
Lab: Shippers Radio Make a PHP page that has a set of radio buttons populated by a northwind query with
Shipper Company Name displaying in a label and the ShipperID serving as the value for the radio button