Hey there Irish_Dave,
I am also fairly new to PHP. I have gone over your code and the html part of it all looks like its in order. You for loop that creates the selector's options works when I hard coded in a number for $subject_count and for $sel_subject['position']. I set $sel_subject['position'] to 3 and $subject_count to 6 and it came out fine with the third option being selected. So that tells me that the array containing the result for $sel_subject['position'] doesnt exist.
Try these debugging strategies:
make sure the information being returned is correct in your database by using print_r():
$sel_subject = get_all_subjects();
echo "<pre>";
print_r($sel_subject);
echo "</pre>";
//Then use the mysql fuction to retuen the numberic value of all the rows.
$subject_count = mysql_num_rows($sel_subject); /* The results contained in $sel_subject HAS to be gotten using MySQL SELECT or SHOW commands only */
echo $subject_count;
//$subject_count + 1 becauce we are adding a subject
for($count=1; $count <= $subject_count+1; $count++)
{
**your code for creating the html options**
}
Making sure the information being returned is correct is a good start to debugging why your script isnt working. Say for instance $subject_count was returning a 0, then your for loop would run and but would only create 1 option and your $sel_subject['position'] would not be echo'd. Also i would comment out the for loop for the moment since its not working at the moment anyways.
It depends on what the print_r($sel_subject) and echo $subject_count; returns to decide where the next problem might or could be.
I am sorry if this post came out very sloppy and hard to read. This is my very first post in this forum. This is just where i would start with your code as nothing jumps out at me as wrong.
I hope this helped Irish_Dave but understand it might not have lmao
thanks
algidDes702