Skip to content

Commit

Permalink
Update admin.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nikrozman21 committed May 3, 2019
1 parent 77cdda5 commit 2bb50ae
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,9 @@
<tbody>

<?php
echo("$server_ip");
echo("$db_username");
$con=mysqli_connect("$server_ip","$db_username","$db_pass","$db_name");

if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} else {
$result = mysqli_query($con,"SELECT * FROM IPs");}

while($row = mysqli_fetch_array($result)) {
$ips = $odb->prepare("SELECT * FROM ips");
$ips->execute();
while($row = $ips->fetch(PDO::FETCH_ASSOC)) {
echo '<tr>';
echo '<td class="column1">'. $row['ip'] . '</td>';
echo '<td class="column2"></td>';
Expand All @@ -65,8 +58,7 @@
echo '<td class="column5"></td>';
echo '<td class="column6"><a class="btn btn-primary btn-sm" href="https://yourwebsite/manage?ip=' . $row['ip'] . '" role="button">Edit</a></td>';
echo '</tr>';}
mysqli_close($con);
?>
?>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 2bb50ae

Please sign in to comment.