Thank you Mac I will look at the array inofrmation on this page.
I did however manage with a while loop and I had to introduce a counter.
So now my system allows for a student to register all the personal details on one form, then on a different form enter a student number and select many courses at once. All working fine, I am spending some time on making things easier for the user. This is very educational.
I would however like some help with the
WHERE cname is_null or whatever it should be as I have tried many different options directly in myPHPAdmin and nothing seems to work.