Welcome! Log In Create A New Profile

Advanced

Prac available

Posted by Mac 
Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar
Mac
Prac available
March 20, 2008 09:47AM
I have made the prac available.
Re: Prac available
March 21, 2008 05:51PM
Hi

starting early as my schedule is a bit hectic with work and my other UNISA subjects.
I have started on the project but have a question on the DB. You supplied a dump of the course and course_student tables but not the student table. Could i get a dump of the table as there is no info as to what data types we must use. What password must we use in our config file, would it matter if its different to yours.

Thanks
Re: Prac available
March 21, 2008 06:12PM
CREATE TABLE `student` (
`sno` int( 6 ) NOT NULL AUTO_INCREMENT ,
`sname` varchar( 40 ) NOT NULL default '',
`init` varchar( 5 ) NOT NULL default '',
`fname` varchar( 40 ) NOT NULL default '',
`title` varchar( 4 ) NOT NULL default '',
`msname` varchar( 40 ) NOT NULL default '',
`dob` varchar( 8 ) NOT NULL default '',
`sex` char( 2 ) NOT NULL default '',
`lang` varchar( 10 ) NOT NULL default '',
`idno` varchar( 13 ) NOT NULL default '',
`telh` varchar( 12 ) NOT NULL default '',
`telw` varchar( 12 ) NOT NULL default '',
`cel` varchar( 12 ) NOT NULL default '',
`fax` varchar( 12 ) NOT NULL default '',
`email` varchar( 40 ) NOT NULL default '',
`address` tinytext NOT NULL ,
PRIMARY KEY ( `sno` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =1;
Re: Prac available
March 22, 2008 10:28PM
Hi
could i please get a copy of the db that we must use as im a bit confused by the tutorial letter. You have provided a dump for courses_student table with sno, cid, year fields but not fmark. Do we need to add fmark ?
avatar
Mac
Re: Prac available
March 23, 2008 08:14AM
Oh goodness, the doc file didn't convert fully to PDF. Strange. I should have checked.... I will repost it.
You can use whatever login and password you want. That's why we want it in one file, so we can change it to ours in just one place.
avatar
Mac
Re: Prac available
March 27, 2008 08:00AM
The full file is now available
Re: Prac available
March 29, 2008 11:31PM
Hi

I downloaded the updated tutorial letter but im still not sure about the db. The dump has three fields sno, cid and year but in the table there are four fields? What is the primary key, must i add fmark ??
avatar
Mac
Re: Prac available
March 31, 2008 07:55AM
This adobe is getting to me... guess it is time to upgrade to a new version.... I noticed the table is also out of sync. Think it is correct now.

The fmark is optional - this prac looks at the registration side, so the student's final course mark is not important. The original idea we had for this field was for you to learn something additional, i.e. when you update or insert, in your sql statement you would just use '' as in $fmark=''
Re: Prac available
April 01, 2008 11:01AM
Hi

I am still have a problem with the db. I am trying to create the course_student table but keep getting the following error.

Error

SQL query:

CREATE TABLE 'course_student'(
'sno'int( 6 ) NOT NULL default '0',
'cid'int( 6 ) NOT NULL default '0',
'year'int( 4 ) NOT NULL default '0'
) ENGINE = MYISAM DEFAULT CHARSET = latin1;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''course_student' (
'sno' int(6) NOT NULL default '0',
'cid' int(6) NOT NULL de' at line 1
avatar
Mac
Re: Prac available
April 01, 2008 02:11PM
Ceate it manually then - sometimes depending on what PHPmyAdmin version you're running and the one it was created with cause these errors.
Or just try

CREATE TABLE 'course_student'(
'sno'int( 6 ) NOT NULL default '0',
'cid'int( 6 ) NOT NULL default '0',
'year'int( 4 ) NOT NULL default '0'
);
Re: Prac available
April 19, 2008 09:50AM
Hi Mac

please could you explain what default '0' means? Can't find any info on it in our book. I am creating the tables in PHPMyAdmin - must I just enter a zero into that definition box or just keep it blank (or is this the same thing?)

Thanks!!!
Re: Prac available
April 19, 2008 10:16AM
and what does default " mean?

thanks!
Re: Prac available
April 19, 2008 11:23AM
another question - sorry!

For the course_student table, you say that the composite key sno, cid, year is defined as the Primary key. So all of these keys would make up the primary key, right? We have defined the sno as the primary key in the student table and the cid as the primary key in the course table. Obviously the year cannot be a primary key, right?

So am I correct in saying that when I create the course-student table in PHPMyAdmin, I do not define any of these fields as primary keys as they have been defined already?
avatar
Mac
Re: Prac available
April 21, 2008 08:39AM
When there is no data in the field, it defaults to 0. Don't break your head over
it.

A composite key means that all the columns does not have to be unique, but their combined value must be unique. And that is what a primary key is - it is unique. So using an ID number would guarantee uniqueness, since no two id numbers can be the same.

So when you have the combination of sno, cid and year, together they are unique. But sno can also be a primary key, since no two students can have the same sno. Think of it fromt he other way - if you send a message to delete a row int he table - how will it know the that row to delete is unique?
Re: Prac available
April 21, 2008 04:13PM
mmm...Well the answer to your last question, I would just think to use the sno as the refernce to delete the row as no two students can have the same student number (as you say)... so can I just make that the primary key when I create the table?

Thanks!!!!spinning smiley sticking its tongue out
Re: Prac available
April 22, 2008 12:18PM
Hi Mac,
It's crucnch time smiling smiley
I have downloaded the prac.pdf but nowhere does it give the project due date...
I'm starting on it next week but wana manage my time accordingly...

Thanks
avatar
Mac
Re: Prac available
April 23, 2008 06:58AM
sno fine for this prac.
Due date as in tut 101 - 9 june
Re: Prac available
April 23, 2008 07:54AM
Morning everyone.

Aeen at work for two hours already. Someone remind me to use Harsh Words when speaking to people who us Access '97 as an enterprise database.

Anyway, re-read all the prac stuff last night. And checked the myUnisa site, and here.

How do we get the prac to you when it is complete? Did I miss something?
avatar
Mac
Re: Prac available
April 23, 2008 09:49AM
No, you did not miss anything.
I normally post it here (see previous forums)
You email it to me, zipped. I unzip it, use your db config file to change the database details to fit my database. Which is why it is important to provide just one config file and to include it in all the other pages, so I don't have to change database details on every page.
Prac available
April 28, 2008 01:41AM
Hey.

Thanks for clearing that up. So we just zip the all our php files as well as the db and email it. Thnks.

I only got the prac today and i think i will have to get a move on. Hope all goes well. Good luck guys.
JwV
Re: Prac available
April 29, 2008 04:37PM
Hi Mac

I am using the GUI environment to create the database and tables. Wat collation do I use - latin1_bin / latin1_general_ci / latin1_general_si.

When creating the tables via the GUI, I don't see a place where I can set the auto increment to 6 (for course table).

After clicking on the create table button the GUI displays :

CREATE TABLE `registration`.`course` (
`cname` VARCHAR( 50 ) NOT NULL DEFAULT '"',
`cid` INT NOT NULL AUTO_INCREMENT ,
PRIMARY KEY ( `cid` )
) ENGINE = MYISAM CHARACTER SET latin1 COLLATE latin1_general_ci


would it be better if the table creation was done vir command line instead of the GUI?


Also default for sname. is the a single " or is it two ' next to each other.
avatar
Mac
Re: Prac available
May 05, 2008 07:13AM
What GUI are you referring to?
ENGINE = MYISAM CHARACTER SET latin1 COLLATE latin1_general_ci is not required.
Why don't you use phpMyAdmin that comes with XAMPP??
Re: Prac available
May 05, 2008 08:18AM
Hi Mac,

Was busy with the prac ova the looooooooonnnnnggggg weekend...
Just want to know if im on the right track...
I used frontpage to design all my pages and forms and just use php
to update/edit/delete records from tables etc etc...(basically what we learnt in this course: sessions,cookies etc etc)
Will i be penelised for this when you mark the project?
avatar
Mac
Re: Prac available
May 05, 2008 08:38AM
I mark the evidence that you have apllied what you have learned. Anything extra (like a nice design) is not marked since that is not the aim of the course.
Re: Prac available
May 05, 2008 08:46AM
the design of the pages/forms are seperate .html files that i 'include'
in my php files (as we have learnt from the studyguide)

for my database&tables i used the mysql datadump you created in the prac.pdf

When running our projects, i assume that the database as well as tables would already be created on your server or should we include php scripts to database/table creation as well?
avatar
Mac
Re: Prac available
May 05, 2008 10:38AM
Yes, the db and tables are already on my server, so all I need to change is the login/password.
JwV
Re: Prac available
May 05, 2008 12:17PM
Hi Mac

Thanks for the info you gave me during the phone conversation. I have dropped my database and recreated it with the dump supplied. When I now check the dump as created by phpmysql it is the same as the one supplied.
JwV
Re: Prac available
May 06, 2008 09:27AM
Hi all

The year field in the table course_student, does any one know what year value must be stored here. Does this table get updated when a student registers.
Prac available
May 06, 2008 09:46AM
Hi.. im not too sure but i think it refers to the year in which the student will do the course. Like registering for php 2008. There are 3 tables. 1 for all the courses, 1 for the students registration details n this 1. The course student table lists only the students per course. So

Example.

Student number | Course id | Year | Final mark
12223 | 245 | 2008 | 98%


When you click that student number it should display the student registration details. Name surname etc. and the same goes for the course id. Thats what I understand from the bottom part of the prac pdf file.

Hope it helps but if any one else cares to provide us with more info plz do so smile
JwV
Re: Prac available
May 08, 2008 02:00PM
Hi MuhammadA

Thanks for the info. It helps. smiling bouncing smiley

Mayby you can help me with a other problem. I am using the statements

switch ($option)
{
case "adm1yes":
header("Location: course_admin.php"winking smiley;
break;
case "adm2yes":
header("Location: student_admin.php"winking smiley;
break;
case "rep1yes":
header("Location: report.php"winking smiley;
break;
}


When I call the switch statement the first time it works. When called a second time I get the error :

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\Valiant\gatekeep.php:6) in C:\xampp\htdocs\Valiant\gatekeep.php on line 29

Can you help me with this one??
Sorry, only registered users may post in this forum.

Click here to login