ReginaRay

Untitled

Jan 16th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.56 KB | None | 0 0
  1. <?php
  2. require "admin.php";
  3. ?>
  4.  
  5. <table border="1px" width="100%">
  6.     <tr>
  7.         <th>Атрибут</th>
  8.         <th>Фото 1</th>
  9.         <th>Фото 2</th>
  10.         <th>Наимен.</th>
  11.         <th>Описание</th>
  12.         <th>Полное опис.</th>
  13.         <th>Цена 1</th>
  14.         <th>Цена 2</th>
  15.         <th>Цена 3</th>
  16.         <th>Производ.</th>
  17.         <th>Удалить</th>
  18.         <th>Редак-ть</th>
  19.     </tr>
  20.    
  21.    <?php
  22.     include ('../db.php');
  23.     $ss = "SELECT * FROM `products` ORDER BY `id` DESC";
  24.     $sql = mysqli_query($connection, $ss);
  25.     $result = mysqli_fetch_assoc($sql);
  26.     do
  27.     {
  28.     echo '<tr>
  29.        <td>'.$result['atribute'].'</td>
  30.        <td>'.$result['image1'].'</td>
  31.        <td>'.$result['image2'].'</td>
  32.        <td>'.$result['name'].'</td>
  33.        <td>'.$result['opis'].'</td>
  34.        <td>'.$result['longopis'].'</td>
  35.        <td>'.$result['price'].'</td>
  36.        <td>'.$result['price1'].'</td>
  37.        <td>'.$result['price2'].'</td>
  38.        <td>'.$result['madein'].'</td>
  39.        <td><a href="?del_id='.$result['id'].'">Удалить</a></td>
  40.        <td><a href="red.php?red_id='.$result['id'].'">Ред-ть</a></td>
  41.    </tr>';
  42.     }
  43.     while ($result = mysqli_fetch_array($sql));
  44.     ?>
  45.    
  46. </table>
  47.  
  48.  
  49. <?php
  50.     include ('../db.php');
  51.         // удаление записи
  52.         $dd = 'DELETE FROM `products` WHERE `id` = '.$_GET['del_id'];
  53.         if(isset($_GET['del_id'])){
  54.             $sql = mysqli_query($connection, $dd);
  55.         }
  56. ?>
Add Comment
Please, Sign In to add comment