The code i am referring to is between the sections of ********** that have been commented in.
OK, i am taking a string from my form 'searchsubmit' and then going through the arrays to find the string to see if it exists. I am using the $found variable to stop searching if the name has been found already. The search works if the name is in 'classone' but not in the next two 'classes'. the script seems to be exiting after seraching the first array and im not sure why. Anyone got any ideas?

You're doing it wrong, use a database. It can be as simple as creating a single table database with a table that has the fields,id, name, and class number. Then you'd be able to search all classes at once, have students that take more than one class, generate a roster by class, etc. with very little code. Plus you won't have to hard code names into arrays etc, and data will persist beyond the length of the session

Thats the long term plan seanandisti. I'm really just beginning my journey into php so what you have on that scrip is everything I currently know. Coming from very little programming experience here and even that was a very long time ago.

As it happens I seem to have fixed the problem by replacing 'elseif' with 'if' although I'm confused as to why there is a difference.

seandisanti is right that better to use database while learning so that you will get to know the use of database too.
in your previous comments you wrote that you are confused as why there is difference.
"As it happens I seem to have fixed the problem by replacing 'elseif' with 'if' although I'm confused as to why there is a difference."

the first if condition will always execute since the $found is false and the first if condition is true.

the use of if.. elseif..elseif...else is that if first 'if' condition is true then code inside first 'if' will be executed. otherwise goes to next if('elseif') to check if that is true to execute the code inside that and so on.

phpmyadmin is a web based interface for mysql that is usually installed and configured automatically with wamp/lamp/xamp. For free video based learning using php and mysql take a look at jream.com. I refer a lot of traffic there because i like the way he does his videos. They're usually less than 10 minutes, and he does well to explain things in plain english without being to overly verbose. He's got videos on mysql and php (and more). Watch this video first; as it is a quick course on mysql and phpmyadmin. http://jream.com/learning/videos/mysql/ ... quickstart

to learn the right way to interact with your mysql database. a lot of the resources out there right now say to use mysql_ functions, but they are deprecated php 5.5 and will be removed in a future version. PDO is faster and more secure, but without a lot of extra work. It's just easier to learn to do it right from the get go.

For general language reference, he's got a basics series, but between what you've already gotten from the other videos, and what you can learn from the first 2 videos, you probably won't need it.