Hi,
myql_fetch_array stores the values twice in the row array,
$rows1[0] = 'aname';
$rows1['name'] = 'aname';
so that you can access the field values in two ways.
Change the code to:
include ('connect.php');
$sp1=("first"); $sp2=("second"); $sp3=("third"); $sp4=("fourth"); $sp5=("fifth");
$vals = array(14,10,8,6,4); $i=1;
while ($i<6) {
$rspa = "sp" . $i; $spa = $$rspa;
$ptstotal = $vals[$i-1];
echo ('<b><u>'.$spa.'</u></b><br>');
$querys1 = "SELECT DISTINCT name FROM sktbl WHERE type='$spa'";
$results1 = mysql_query($querys1) or die("Connection S1 died!") ;
while ( $rows1 = mysql_fetch_array($results1) ) {
echo $rows1['name'].'<br>';
}
echo ('<br>');
$i++;
}
or use mysql_fetch_assoc instead.
Thomas