Welcome! Log In Create A New Profile

Advanced

Prac

Posted by Mac 
Announcements Last Post
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
Re: Prac
May 21, 2006 08:47PM
thanks Mac - v helpful indeed

two questions:

how do you want this prac submitted. All the files zipped up and mailed to you, or/and installed on a server and url emailed to you?


I see in the textbook and elsewhere more than more script exists per file. I have been working with a different file per script, eg, a delete_course.php and a separate add_course.php and then a separate edit_course.php. I just find it easier to manage and work out what is not working. But are there any benefits to having the scripts together in one file?
Re: Prac
May 21, 2006 08:55PM
Managed to solve my problem with students being registered for all courses in the database.

Now, the student no. does not get written to the course_student table, but the course id does.

Oh well, back to the drawing board.
Re: Prac
May 21, 2006 10:00PM
another question re the prac:

I am trying to register a student for the course, adding info to the student and course_student tables

how do you add data to two separate tables at once? As far as I can see from googling, you can UPDATE multiple tables at once but INSERT doesn't allow you to do this. Do I need to define two separate $query statements?
avatar
Mac
Re: Prac
May 22, 2006 07:53AM
Libby

2 options:
I will provide a facilty to upload the prac to our server, Osprey.
That will require you to change the connection code in your files to fit Osprey.

Or you can puse your own server, and send the url. BUT you still need to post the files to Osprey, since I need to look at the code. But no need to change files for Osprey.

2 query statements.
Re: Prac
May 22, 2006 11:20AM
writing student no. to course_student solved.


Re: Prac
May 22, 2006 09:30PM
I am having problems inserting data into course_student. All I get inserted into the table are zeroes. But I notice through phpmyadmin that there is no index defined for that table. Could that be the problem? And if so, how do I go about defining an index?
Re: Prac
May 22, 2006 09:49PM
I do not think you need an index in the course_student table.

I am also not yet able to to write to this table, I have all the variables on the correct page but I have not yet sorted out how to send the array data off to the db.

I am able to CRUD the other two tables.

I must say I am enjoying the project way more than the earlier stuff

I have still not beaten 5C.

Re: Prac
May 22, 2006 10:20PM
I'm wondering if we shouldn't be using mysql_insert_id to insert data into course_student. Any ideas on how to use that?
Re: Prac
May 22, 2006 10:29PM
Angus, Libby

You don't need indexes in this table.

Insert the values into the table through the normal INSERT INTO table ( ) VALUES ( ) method.

I also found that insert_last_id() is much easier to use than mysql_insert_id().
Re: Prac
May 23, 2006 11:03AM
Apologies. My brain was working in reverse last night.

That should be LAST_INSERT_ID()
Sorry, you do not have permission to post/reply in this forum.