<snip> $result = mssql_query("SELECT * FROM files WHERE file_id = '$cat_name' ORDER BY file_name ASC");
$i = $col_num; $j = 0; $filename= mssql_result($result,0,"file_name"); $fileID = mssql_result($result,0,"file_id"); for ($k = 0; $k < mssql_num_rows($result); $k++) { //changes row color if (fmod($k, 2)){$rowColor = "$oddcolor";}else{$rowColor = "$evencolor";} echo ("<TR bgcolor=$rowColor>"); for ($j = 0; $j < $i; $j++) { echo ("<td><a href=index.php&ID=$fileID_id>$filename</a>". "Name: <strong>$getimage_name</strong>". "<a href='index.php&ID=$fileID">Delete</a></td>"); } echo ("</TR>"); } </snip> Unless I am misuderstainding what you want to do, you need to reassign $filename and $fileID_id variables in your loop somewhere using the mssql_result function. The way the loop is working now they will be the same throught the entire loop. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php