Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbhost='localhost';
- $dbusername='root';
- $dbuserpass='ascent';
- $dbname='listado';
- // Conexion a la base de datos
- $con = mysqli_connect ($dbhost, $dbusername, $dbuserpass);
- mysqli_select_db($con, $dbname) or die("Cannot select database");
- if(empty($_GET)){
- $result = mysqli_query($con, "SELECT * FROM ausuario");
- $result_exist = mysqli_num_rows($result);
- if ($result_exist>0)
- {
- echo '<table border=1><tr align=center valign=middle><td>Borrar</td><td>Id</td><td>Equipo</td><td>Appacceso</td><td>Webacceso</td><td>Puntos</td><td>Logros</td></tr>';
- while ($row = mysqli_fetch_assoc($result)) {
- print '<tr align= center valign= middle><td><a href="xxx-admin.php?borra='.$row['id'].'">ok</a></td><td><b>'.$row['id'].'</td><td>'.$row['equipo'].'</b></td>';
- print '<td>'.$row['appacceso'].'</td><td>'.$row['webacceso'].'</td><td>'.$row['puntos'].'</td><td>'.$row['logros'].'</td></tr>';
- }
- echo '</table>';
- }
- else
- {
- echo 'No Hay Registros';
- }
- }
- else
- {
- if (!empty($_GET["borra"])) {
- $result = mysqli_query($con, "SELECT Id FROM ausuario Where Id=".$_GET["borra"]);
- $result_exist = mysqli_num_rows($result);
- if ($result_exist>0){
- mysqli_query($con, "DELETE FROM ausuario Where Id=".$_GET["borra"]);
- mysqli_select_db($con, 'ausuario');
- header("Location: xxx-admin.php");
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement