#native_company# #native_desc#
#native_cta#

Building WML Sites Page 2

By Andres Baravalle
on February 21, 2001

Preparing to work

If you use Microsoft OS, you
can install the NOKIA Development Kit. It checks
for your syntax and lets you preview your WML pages
with a phone-like user interface. Moreover, the kit
comes equipped with useful documentation about WML
and WMLScript. This helps if you don’t have a mobile
phone with WAP support, or if you can’t use a WAP
gateway.
To download it, you have first
to register as a wap
developer
. Remember that you need the Java2
Runtime Enviroment
. However, any text editor
is fine for writing your pages.
Before writing any PHP/WML
code, you need to set up your MySQL tables.
The database is structured in
4 tables.
  1. table professors contains data about professors
  2. table subjects contains data about subjects
  3. table exams contains data about exams
  4. table teach contains the relations between
    the professors and their subjects
Write the code below after establishing
a MySQL connection.
CREATE TABLE professors (
	Id int(11) DEFAULT '0' NOT NULL auto_increment,
	Surname varchar(24) NOT NULL,
	Name varchar(24) NOT NULL,
	Email varchar(48) DEFAULT 'Not avaliable',
	Cod_course varchar(16) DEFAULT 'Not avaliable',
	Consulting_hour varchar(128) DEFAULT 'Not avaliable', 
	Consulting_place varchar(128) DEFAULT 'Not avaliable',
	PRIMARY KEY (Id)
);
These lines specifiy the structure
of table professors. Id is the field for associating
an unique identifier with each professor and is the
key of the table. The other fields, Surname, Name, Email specifies
the surname, the name and the e-mail address for
each professor. Cod_course assumes unique
values identifying the subjects. Finally, Consulting_hour and Consulting_place specify
the receiving time and the place for receiving.
CREATE TABLE subjects (
	Subject varchar(96) NOT NULL,
	Cod_Subject varchar(24) NOT NULL,
	Cod_number varchar(12) NOT NULL,
	PRIMARY KEY (Cod_subject )
); 
Subject is the name of the subject, Cod_subject is
the field containing the unique name adopted by the
University for the subject and is the key of the
table. Cod_number is a numeric field containing
a number grouping different courses on the same subject.
CREATE TABLE exams (
	Cod_Subject varchar(24) NOT NULL,
    Id int(11) NOT NULL,
    Date date DEFAULT '0000-00-00',
    Time time DEFAULT '00:00:00',
    Room varchar(64),
    Test varchar(16) DEFAULT 'Oral'
); 
Cod_subject again contains
the unique name adopted by the University for the
subject,Id is the unique identifier for the
professors, Date, Time, and Room,
record the date, the time and the place where exams
will take place; Test is for the type of the
exam (written, oral, or anything else).
CREATE TABLE teach (
	Cod_Subject varchar(16) NOT NULL,
	Id int(11) DEFAULT '0' NOT NULL,
	PRIMARY KEY (Id, Cod_subject )
); 
In table teach the two
fields form the key and are necessary to know who
is teaching what.
The next step is filling the
database with some data, which you can do by yourself.