Web site builder - 386 CHAPTER 13 CASE STUDY: USING PHP
January 7th, 2008386 CHAPTER 13 CASE STUDY: USING PHP FOR AN XML APPLICATION This table stores the date of the forecast, the maximum and minimum temperatures, and the current weather conditions. The current conditions come from values in the weatherWeatherTypeID field. This foreign key is associated with the weatherType table: CREATE TABLE weatherType ( weatherTypeID int(11) NOT NULL auto_increment, weatherType varchar(40) default NULL, PRIMARY KEY (weatherTypeID) ) TYPE=MyISAM; The last section of the SQL script inserts the default weather conditions into the weatherType table: INSERT INTO weatherType VALUES (1,’hot’); INSERT INTO weatherType VALUES (2,’sunny’); INSERT INTO weatherType VALUES (3,’windy’); INSERT INTO weatherType VALUES (4,’cloudy’); INSERT INTO weatherType VALUES (5,’rain’); INSERT INTO weatherType VALUES (6,’rainstorms’); INSERT INTO weatherType VALUES (7,’snow’); INSERT INTO weatherType VALUES (8,’snowstorms’); Each of these weather types has an associated image in the images folder. In phpMyAdmin, switch to the SQL section and copy and paste the contents of the weather.sql file into the Run SQL queries section of the page, as shown in Figure 13-3. Figure 13-3. Running the SQL script in phpMyAdmin
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.