CIS 627 (Web Database Services Development) Week 4
Session Variables, Cookies, Database Inserts, Etc.
-
Session Variables and Cookies
Possible resources:
-
Setting up the BIRT ClassicModel Database
Possible resources:
- Source: http://www.eclipse.org/birt/resources/documentation/sample-database/birt-database-2_0_1.zip
- Use PHPMyAdmin to create a new database called classicmodels. Click on the top of the lefthand column. Under the
Databases tab, enter the name of your new database (classicmodels) and click Create.
- Select the classicmodels database on the left and the SQL tab, then copy and paste
this SQL script create_classicmodels.zip click Go
to create the database tables.
- Use the datafiles datafiles_classicmodels.zip
to add data to the files. For example, expand the classicmodels database on the left, click on the customers table,
choose the import tab, browse for the file, choose the Character-set to be UTF-8 without BOM, choose the format to be csv, and
click Go. The original Customers.txt from the above source had an ANSI encoding. I converted it to utf-8 using
Notepad++. The zip file I have provided has already converted data files. The screen capture below shows the
Encoding conversion taking place.
I also added two blank fields to the end of each line of the ProductLines.txt file.
-
Inserting Data into a database
Possible resources
- Programming PHP (Tatroe, MacIntyre & Lerdorf) p. 207
- AddSupplier.zip Simple Add a supplier to the Northwind database --
no field validation
-
Reading an XML file both local and remote
Possible resources:
-
Read JSON from file
Possible resources:
-
Joins
Possible resources:
-
Assignment
Parts:
- Create the BIRT ClassicModel Database and populate it as discussed above.
- What is meant by BOM in the context of a character encoding?
- Add the auto-increment functionality to the officeCode field in the offices table
(Ref. http://stackoverflow.com/questions/5035836/how-to-add-auto-increment-to-an-existing-column)
- Make a form to handle the insertion of a new office in the ClassicModel Database.
- Make a page that displays the results of a join query on the ClassicModel Database showing the
employees (last and first names) and the office (city) they work in.
- Use the data from IMDB.zip to display information
about the top ten movies from IMDB in a jQuery accordion.