In sindex where it says:
$rs = "select from subscriber blah blah"
$rsCheck=mysql_query($rsQcheck);
make it say
$rsCheck=mysql_query($rsQcheck) or die (mysql_error());
and same for any mysql_query($whatever).
Its looking like your querys are returning any results. That can be because the dbs don't exist, or the syntax is bunged up or maybe permissions. Because I can't see your database structure I can't tell which. the mysql_error will tell you what the problem is.
on nindex put the same mysql_error on the insert block too. I don't use extract but once the other errors are cleaned up it should work. If not I'll rewrite that block for you to not use extract.
Its also possible you need to do the insert part of this script once to get some records in there.
Don't worry about the header errors, once the script runs clean they will probably go away.