anons Posted December 22, 2008 Share Posted December 22, 2008 Hello members I'm in trouble with my source code in php which is related with LDAP when I'm adding a new entry my output table will increased automatically but when I want to remove the entry I don't know how to decrease the html table Can someone help me how to solve it here is the source code Thank you $result = ldap_search($ldapserver,$base_dn,$filter,$inforequired); $info = ldap_get_entries($ldapserver,$result); if($info["count"] == 0) { print "<p>No information available"; } else { print "<table border=2><tr>" . "<th>First and Last name" . "<th>GivenName" . "<th>Department" . "<th>OfficePhone" . "<th>Mail" . "<th>MobilePhone" . "<th>Edit" . "<th>Delete"; for($i=0;$i<$info["count"];$i++) { $row[$i] = "<tr>" . "<td> " . $info[$i]["cn"][0] . "<td> " . $info[$i]["sn"][0] . "<td> " . $info[$i]["departmentnumber"][0] . "<td> " . $info[$i]["telephonenumber"][0] . "<td> " . $info[$i]["mail"][0] . "<td> " . $info[$i]["mobile"][0] . "<td><a href=\"modifyTeacher1.php?mail=" . urlencode($info[$i]["mail"][0]) . "\">Edit</a></td>" . "<td><a href=\"deleteTeacher2.php?mail=" . urlencode($info[$i]["mail"][0]) . "\">Delete</a></td>"; } sort($row); for($i=0;$i<$info["count"];$i) print $row[$i++] . "\n"; print "</table>"; } print "</body></html>"; ?> Link to comment https://forums.phpfreaks.com/topic/137996-php-row-decrement/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.