I got it working but have no idea why. All I did was move the $delete and $view ternarys on top as opposed to the bottom of the loop. Why would it work just because they were moved to the top??
////GET CREDITORS
$creditlist="SELECT * from credits WHERE nsirowid='$line[id]'";
$creditresult=mysql_query($creditlist) ;
$creditline= mysql_fetch_array($creditresult, MYSQL_ASSOC);
$delete = ( $creditline[charged]== 'YES') ? 'Delete' : "<a class='sql' href= DeleteNSIitem.php?orderid=$getnsiline[orderid]&rowid=$line[id]; onClick= \"return confirm_entry()\">Delete</a>";
$view = (!$creditline) ? 'View' : "<a class='sql' href=\"#\" onclick=\"window.open('viewcredit.php?id=" . $creditline[id] ."', '',
'width=550,height=290,status=no'); return false;\">View</a>";
$edit = ( $creditline[charged]== 'YES' || !$creditline) ? 'Edit' : "<a class='sql' href=\"#\" onclick=\"window.open('editcredititem.php?rowid=" . $line[id] ."', '',
'width=550,height=220,status=no'); return false;\">Edit</a>";
$creditline = ($creditline) ? "$creditline[enterdate]" : "<a class='sql' href=\"#\" onclick=\"window.open('creditnsiitem.php?rowid=" . $line[id] ."', '',
'width=550,height=290,status=no'); return false;\">Credit</a>";