Welcome! Log In Create A New Profile

Advanced

confused smiley Help please - final prac - login error for mySQL after editing user with phMyAdmin

Posted by Anonymous User 
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
confused smiley Re: Re: Re: Help please - final prac - login error for mySQL after editing user with phMyAdmin
October 30, 2008 06:59AM
Quote
bothajar
Maybe I understand wrongly. I was under the impression that we had to get the courses in the drop down list from the course table by using php. It seemed to me that all people were trying to solve the problems of how to deal with the drop down list as one of the primary problems. But now it seems to me that we are supposed to hard code the courses in HTML. Seems to me that is what was done in all examples too. If that is the case we have all wasted valuable time.What are we supposed to do?

If you hardcode the course information you'll have problems if the administrator makes changes to the database. They could delete a course or change the name for the course which would then not match your hard coded information.
avatar
Mac
confused smiley Re: Re: Re: Help please - final prac - login error for mySQL after editing user with phMyAdmin
October 30, 2008 07:38AM
I honestly don't see how these two questions relate? You asked:

Moreover, how can a year be unique? Whatever chosen, e.g. year of registration, birth, a year will never be unique???

Noelses question was what the year is?

In any event, I answered that you there that you should ignore the extra info column (which really is just extra info for thise who are interested in more)where it says the year is unique, since it really refers to what is known as a composite key, and that you should not worry too much about it - just use the dump.

Iris.Philipp Wrote:
-------------------------------------------------------
> The answer to Noelles question for the year is
> good to see although I already asked for it Oct
> 20???!!!
> - see the thread: Problem in setting the
> relation of course_student to the other tables -
> the last question related to the year in this
> table.....
>
> Iris
avatar
Mac
confused smiley Re: Help please - final prac - login error for mySQL after editing user with phMyAdmin
October 30, 2008 07:43AM
The drop down for courses is and should be drawn from the database. The coding examples provided does generate dynamic drop-down boxes, in that when a course name is changed in the course table, then it will appear correctly in the drop-down menu.

The only hard coding referred to that I am aware of is related to the date for registration. While one can use PHP to generate today's date and insert that into the db, there is nothing wrong with hardcoding it, either in a drop-down list or using Javascript, such as the example I provided. Here you should make use of your HTML experience to decide.

//this is HTML hard code
<select name=day>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
....
<select name=month>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
....
<select name=year>
<option value=2008>2008</option>
<option value=2009>2009</option>
<option value=2010>2010</option>
....

//this is PHP
$today = date("d M Y"winking smiley;

So either he selects todays date from the HTML drop downs, or you don't even provide an option to select the date - PHP generates the date on the day the form is submitted. Then again you may decide that you want to use PHP but provide an opportunity to change the date for whatever reason.

$day= date("d"winking smiley;
$month= date("M"winking smiley;
$year= date("Y"winking smiley;
<input type=text name=day value=$day>$day</text> etc.

Point is, there are many ways to do this and we won't push one way of doing it, since it depends on what you want to achieve. It is your application and you decide how you want to logic it. Which is why you will have to Google, since there is no way we can provide you with all that PHP can do or not do.
confused smiley Re: Help please - final prac - login error for mySQL after editing user with phMyAdmin
October 31, 2008 03:46PM
Mostlty having fun ,just had a few problems with passing variables between pages
,that's kind of sorted out ,Mac do we email the files directly to you once finnished?


Sharp! Sharp!
avatar
Mac
confused smiley Re: Help please - final prac - login error for mySQL after editing user with phMyAdmin
November 02, 2008 10:56AM
Yes.Make sure you zip from the top directory, which should be named your student number, so when I unzip it, the directories is created correctly (if you made use of directories).
Sorry, only registered users may post in this forum.

Click here to login