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.
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.
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.
code, you need to set up your MySQL tables.
The database is structured in
4 tables.
4 tables.
- table
professors
contains data about professors - table
subjects
contains data about subjects - table
exams
contains data about exams - table
teach
contains the relations between
the professors and their subjects
Write the code below after establishing
a MySQL connection.
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.
an unique identifier with each professor and is the
key of the table. The other fields,
the surname, the name and the e-mail address for
each professor.
values identifying the subjects. Finally,
the receiving time and the place for receiving.
of table professors.
Id
is the field for associatingan unique identifier with each professor and is the
key of the table. The other fields,
Surname
, Name
, Email
specifiesthe surname, the name and the e-mail address for
each professor.
Cod_course
assumes uniquevalues identifying the subjects. Finally,
Consulting_hour
and Consulting_place
specifythe 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,
the field containing the unique name adopted by the
University for the subject and is the key of the
table.
a number grouping different courses on the same subject.
Cod_subject
isthe 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 containinga 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 containsthe unique name adopted by the University for the
subject,
Id
is the unique identifier for theprofessors,
Date
, Time
, and Room
,record the date, the time and the place where exams
will take place;
Test
is for the type of theexam (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
fields form the key and are necessary to know who
is teaching what.
teach
the twofields 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.
database with some data, which you can do by yourself.