Welcome! Log In Create A New Profile

Advanced

OOP5

Posted by waldo 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/17/2019 02:24PM
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
OOP5
April 16, 2012 02:18PM
Hi Mac

I really don't understand want I suppose to do with oop5. Do I need to change the data in my user_friends table or am I suppose to use an If else to force the relationships between user_id and friend_id.

thanks
Re: OOP5
April 16, 2012 04:29PM
I'm getting confused with regard to oop5 question I don't know whether we still using select form or come up with new version of accomplishing
this question. It seems as they used for loop or ... eish I really dont get it
Mac please give us a glue
avatar
Mac
Re: OOP5
April 16, 2012 04:30PM
In oop 4 you used the user_id to indicate who is a friend. Now you need to use first & last name. That implies that you first need to draw the user_id and then find the relevant first & last name from a different table.If you use and if/else that means you will have to add an if/else statement to every new person added to the database. And that is not very efficient....the code must handle it.
Re: OOP5
April 16, 2012 06:59PM
Hi Mac

Last question, we don't change the current table data.
We use it in its current form, meaning the way we initially got it.
avatar
Mac
Re: OOP5
April 17, 2012 06:55AM
Perhaps.... you need to figure that out.
Re: OOP5
April 17, 2012 12:27PM
Hi Mac

The data in the form is wrong. The only way for me to get the output is when I change the data in the table. If I select Elvis Presley this is the output I'm getting.

OUTPUT
========
User known as: King of Rock

Friends with: ElvisPresley

Friends with: PollenNdlanya

Friends with: ClarkKent

Return
Re: OOP5
April 17, 2012 12:29PM
Hi Mac

I meant tut_102 is wrong
avatar
Mac
Re: OOP5
April 17, 2012 12:43PM
No, tut 102 oop5 is what it must show, so change what you must to get to that result. It will do nothing to the output of oop4, because there I did not supply a full list of outputs.
Re: OOP5
April 17, 2012 01:30PM
Hi Mac

Made some modifications and I think its okay now.

Now if I select on elvis on OOP4, this is the output I'm getting.

OUTPUT - oop4
=============
User known as: Peter Pan

Friends with: 3, 5

User known as: Peter Pan

Return



User known as: King of Rock

Friends with: 5, 1

User known as: King of Rock

Return


But on OOP5 I'm getting the following outputs.

OUTPUT
=======
User known as: Peter Pan

Friends with: PollenNdlanya

Friends with: Kaizer Motaung

Return


User known as: King of Rock

Friends with: Kaizer Motaung

Friends with: PeterPan

Return


User known as: Trompies

Friends with: ClarkKent

Friends with: ElvisPresley

Return


Hope this will be sufficient. I cannot think of another way of doing this
Re: OOP5
April 17, 2012 02:46PM
Mac would get wrong if i can create new table
Re: OOP5
April 17, 2012 03:03PM
Mac
I've problem with opening txt file on new window. I've passed code for that and it's opening on new window but
problem is not opening s text file. It still display my php variables
This thing started from assigment I tried so many times I even went to fellow students who managed to get it
right and they did try but never get right.I even thoght of operating system but I'm not sure wheter OS affect php
or not.
help please
avatar
Mac
Re: OOP5
April 17, 2012 04:17PM
Well, read the response from waldo above and figure it out...

Have you read this post regarding the text file? http://osprey.unisa.ac.za/phorum/read.php?697,163523
Re: OOP5
April 17, 2012 04:40PM
No, I have not see it before
avatar
Mac
Re: OOP5
April 18, 2012 05:19PM
Uhm.... then read it? I expect you to use this forum as intended and NOT as a Q&A facility.
avatar
Mac
Re: OOP5
April 24, 2012 06:44AM
oop4 reads that data from the user_friend table, and returns the friend_id only.

oop5 does the same, but now uses the friend_id to go and fetch the first and last names from the users table. You need to fix the users_friend data so it shows the data as in the screenshots.
Re: OOP5
April 27, 2012 03:36PM
@Waldo

Can you give me a clue to that output of oop5?

I have finished oop4, but I am lost.

Helps,
Re: OOP5
April 30, 2012 08:11AM
Dear Marc,

Peter Pan has no friendship with some one, how can we find him in friendship with King of Rock?

User known as: King of Rock

Friends with: Kaizer Motaung

Friends with: PeterPan

Return


Is there any erros from my side or from database?
avatar
Mac
Re: OOP5
May 02, 2012 06:48AM
I am not Marc.... which leads me to believe that you do not read with attention? Read my last post attentitvely...
Re: OOP5
May 02, 2012 12:46PM
Thank you Mac
Re: OOP5
May 03, 2012 08:23AM
Dear Mac,

By correcting oop5, the oop4 has changed to 5,1 as friend ID in the output, and if I change so that by selecting Elvis, 2,5 IDs be displayed, the oop5 will not be
as in the screenshots for oop4.php and oop5.php are using the same user.php code of class.
Am I correct or some thing is going wrong?

Yours advices,
avatar
Mac
Re: OOP5
May 03, 2012 02:35PM
The screenshot in oop4 is just an example of the output the required (i.e. figures as opposed to names). The screenshots in oop5 is required, therefore oop5 overrides oop4.
Sorry, you do not have permission to post/reply in this forum.